Преглед на файлове

[spark] Fix issue when there are not images in the result

This fixes an issue that occurs when the result does not have the image attribute defined.
Johan Ahlen преди 10 години
родител
ревизия
699eb659af
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      apps/spark/src/spark/static/spark/js/spark.ko.js

+ 2 - 1
apps/spark/src/spark/static/spark/js/spark.ko.js

@@ -99,6 +99,7 @@ var Result = function (snippet, result) {
     });
     self.fetchedOnce(false);
     self.data.removeAll();
+    self.images.removeAll();
     self.logs('');
     self.startTime(new Date());
     self.endTime(new Date());
@@ -427,7 +428,7 @@ var Snippet = function (vm, notebook, snippet) {
           _tempData.push(row);
         });
 
-        self.result.images(data.result.images);
+        self.result.images(typeof data.result.images != "undefined" && data.result.images != null ? data.result.images : []);
 
         $(document).trigger("renderData", {data: _tempData, snippet: self, initial: _initialIndex == 0});