Skip to content

Commit cad5dfe

Browse files
author
Walter Bender
committed
catch error when LocalPlanet is null
1 parent 2051a28 commit cad5dfe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

planet/js/Planet.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ class Planet {
5555
};
5656

5757
open(image) {
58-
this.LocalPlanet.setCurrentProjectImage(image);
59-
this.LocalPlanet.updateProjects();
60-
this.oldCurrentProjectID = this.ProjectStorage.getCurrentProjectID();
58+
if (this.LocalPlanet === null) {
59+
console.log("Local Planet unavailable");
60+
} else {
61+
this.LocalPlanet.setCurrentProjectImage(image);
62+
this.LocalPlanet.updateProjects();
63+
this.oldCurrentProjectID = this.ProjectStorage.getCurrentProjectID();
64+
}
6165
};
6266

6367
saveLocally(data, image) {

0 commit comments

Comments
 (0)