Преглед изворни кода

HUE-6464 [editor] Prevent transient js error when switching apps in pauseAppIntervals

VM164:5935 Uncaught TypeError: Cannot read property 'split' of null
    at http://127.0.0.1:8000/static/desktop/js/hue4.utils.js:75:87
    at Array.forEach (native)
    at window.pauseAppIntervals (http://127.0.0.1:8000/static/desktop/js/hue4.utils.js:74:18)
    at http://127.0.0.1:8000/hue/:5935:20
    at Array.forEach (native)
    at OnePageViewModel.self.loadApp (http://127.0.0.1:8000/hue/:5934:22)
    at http://127.0.0.1:8000/hue/:6060:22
    at http://127.0.0.1:8000/static/desktop/js/hue-bundle.js:45:13117
Romain Rigaux пре 8 година
родитељ
комит
e3a90b5
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      desktop/core/src/desktop/static/desktop/js/hue4.utils.js

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/hue4.utils.js

@@ -72,7 +72,7 @@
    */
   window.pauseAppIntervals = function (app) {
     hueIntervals.forEach(function (interval) {
-      if (typeof interval.app !== 'undefined' && (interval.app === app || interval.app.split('-')[0] === app)) {
+      if (typeof interval.app !== 'undefined' && (interval.app === app || (interval.app.split('-') && interval.app.split('-')[0] === app))) {
         interval.status = 'paused';
         originalClearInterval(interval.id);
       }