mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
storage.js: Avoid to call JSON.parse with an empty string
IE11 seems not to like this..
This commit is contained in:
parent
9561057b81
commit
f11de266f4
@ -44,8 +44,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Icinga.Storage.subscribers[event.key] !== 'undefined') {
|
if (typeof Icinga.Storage.subscribers[event.key] !== 'undefined') {
|
||||||
|
var newValue = null,
|
||||||
|
oldValue = null;
|
||||||
|
if (event.newValue.length) {
|
||||||
|
newValue = JSON.parse(event.newValue);
|
||||||
|
}
|
||||||
|
if (event.oldValue.length) {
|
||||||
|
oldValue = JSON.parse(event.oldValue);
|
||||||
|
}
|
||||||
|
|
||||||
Icinga.Storage.subscribers[event.key].forEach(function (subscriber) {
|
Icinga.Storage.subscribers[event.key].forEach(function (subscriber) {
|
||||||
subscriber[0].call(subscriber[1], JSON.parse(event.newValue), JSON.parse(event.oldValue), event);
|
subscriber[0].call(subscriber[1], newValue, oldValue, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user