Skip to content

Commit 9782fa6

Browse files
committed
fix: check if the project path is set before fetching branches
1 parent 7402804 commit 9782fa6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/ChatInput/useCreationWorkspace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export function useCreationWorkspace({
5050

5151
// Load branches on mount
5252
useEffect(() => {
53+
// This can be created with an empty project path when the user is
54+
// creating a new workspace.
55+
if (!projectPath.length) {
56+
return;
57+
}
5358
const loadBranches = async () => {
5459
try {
5560
const result = await window.api.projects.listBranches(projectPath);

0 commit comments

Comments
 (0)