Skip to content

Commit 84ea765

Browse files
authored
BUG FIX: Classifiers might me empty (#2062)
* classifiers might me empty * return null if stored cache is null
1 parent d90de58 commit 84ea765

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

services/web/client/source/class/osparc/data/Resources.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,9 @@ qx.Class.define("osparc.data.Resources", {
652652
} catch (err) {
653653
return null;
654654
}
655+
if (stored === null) {
656+
return null;
657+
}
655658
if (typeof stored === "object" && Object.keys(stored).length === 0) {
656659
return null;
657660
}

services/web/client/source/class/osparc/store/Store.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ qx.Class.define("osparc.store.Store", {
117117
},
118118
classifiers: {
119119
check: "Array",
120-
init: [],
120+
init: null,
121+
nullable: true,
121122
event: "changeClassifiers"
122123
}
123124
},
@@ -419,7 +420,7 @@ qx.Class.define("osparc.store.Store", {
419420
getAllClassifiers: function(reload = false) {
420421
return new Promise((resolve, reject) => {
421422
const oldClassifiers = this.getClassifiers();
422-
if (!reload && oldClassifiers.length) {
423+
if (!reload && oldClassifiers !== null) {
423424
resolve(oldClassifiers);
424425
return;
425426
}

0 commit comments

Comments
 (0)