avoid total UI failing on project load

This commit is contained in:
Val Erastov 2018-02-02 18:07:08 -08:00
parent c6b17c60e5
commit ccea7762e8

View file

@ -29,12 +29,16 @@ export function activate({services, bus}) {
}
function load() {
let data = services.storage.get(services.project.projectStorageKey());
if (data) {
let history = JSON.parse(data).history;
if (history) {
services.craft.reset(history);
try {
let data = services.storage.get(services.project.projectStorageKey());
if (data) {
let history = JSON.parse(data).history;
if (history) {
services.craft.reset(history);
}
}
} catch (e) {
console.error(e);
}
}