Skip to content

Commit eabe396

Browse files
authored
🐛 [Frontend] Fix: File Picker's getOutput helper (#8683)
1 parent 5585566 commit eabe396

File tree

1 file changed

+3
-4
lines changed
  • services/static-webserver/client/source/class/osparc/file

1 file changed

+3
-4
lines changed

services/static-webserver/client/source/class/osparc/file/FilePicker.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ qx.Class.define("osparc.file.FilePicker", {
6666
statics: {
6767
getOutput: function(outputs) {
6868
const output = outputs.find(out => out.getPortKey() === osparc.data.model.NodePort.FP_PORT_KEY);
69-
return output.getValue();
69+
// output can be undefined
70+
return output ? output.getValue() : null;
7071
},
7172

7273
getFilenameFromPath: function(output) {
@@ -231,9 +232,7 @@ qx.Class.define("osparc.file.FilePicker", {
231232
});
232233
} else if (osparc.file.FilePicker.isOutputDownloadLink(node.getOutputs())) {
233234
const outFileValue = osparc.file.FilePicker.getOutput(node.getOutputs());
234-
if (osparc.utils.Utils.isObject(outFileValue) && "downloadLink" in outFileValue) {
235-
osparc.utils.Utils.downloadLink(outFileValue["downloadLink"], "GET", outFileValue["label"], progressCb, loadedCb);
236-
}
235+
osparc.utils.Utils.downloadLink(outFileValue["downloadLink"], "GET", outFileValue["label"], progressCb, loadedCb);
237236
}
238237
},
239238

0 commit comments

Comments
 (0)