widget_base: make deep copy robust to null values

This commit is contained in:
jean-emmanuel 2017-04-04 12:30:28 +02:00
parent 45ba2492c7
commit 833e028ffc

View file

@ -64,6 +64,10 @@ module.exports = class _widgets_base {
var copy = obj,
key
if (obj === null) {
return obj
}
if (typeof obj === 'object') {
copy = Array.isArray(obj) ? [] : {}
for (key in obj) {