Skip to content

Commit 80401f0

Browse files
committed
fix crash reported by a user
1 parent 05a4e83 commit 80401f0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/packages/frontend/project_store.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,20 @@ export class ProjectStore extends Store<ProjectStoreState> {
404404
if (listingStored == null) {
405405
return {};
406406
}
407-
if ((listingStored != null ? listingStored.errno : undefined) != null) {
408-
return { error: misc.to_json(listingStored) };
407+
try {
408+
if (listingStored?.errno) {
409+
return { error: misc.to_json(listingStored) };
410+
}
411+
} catch (err) {
412+
return {
413+
error: "Error getting directory listing - please try again.",
414+
};
415+
}
416+
417+
if (listingStored?.toJS == null) {
418+
return {
419+
error: "Unable to get directory listing - please try again.",
420+
};
409421
}
410422

411423
// We can proceed and get the listing as a JS object.

0 commit comments

Comments
 (0)