Ver Fonte

HUE-7520 [editor] Prevent JS error from being thrown when closing the session

Johan Ahlen há 8 anos atrás
pai
commit
79f6cf16a1

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -2407,7 +2407,7 @@ var EditorViewModel = (function() {
       $.post("/notebook/api/close_session", {
         session: ko.mapping.toJSON(session)
       }, function (data) {
-        if (! silent && data.status != 0 && data.status != -2) {
+        if (! silent && data && data.status != 0 && data.status != -2 && data.message) {
           $(document).trigger("error", data.message);
         }