File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -133,9 +133,14 @@ function connectStream() {
133
133
}
134
134
135
135
function updateSettings ( settings ) {
136
- var changes = utils . modifications ( flags , settings ) ;
137
- var keys = Object . keys ( changes ) ;
136
+ var changes ;
137
+ var keys ;
138
138
139
+ if ( ! settings ) { return ; }
140
+
141
+ changes = utils . modifications ( flags , settings ) ;
142
+ keys = Object . keys ( changes ) ;
143
+
139
144
flags = settings ;
140
145
141
146
if ( useLocalStorage ) {
@@ -299,4 +304,4 @@ module.exports = {
299
304
300
305
if ( typeof VERSION !== 'undefined' ) {
301
306
module . exports . version = VERSION ;
302
- }
307
+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function clone(obj) {
18
18
19
19
function modifications ( oldObj , newObj ) {
20
20
var mods = { } ;
21
-
21
+ if ( ! oldObj || ! newObj ) { return { } ; }
22
22
for ( var prop in oldObj ) {
23
23
if ( oldObj . hasOwnProperty ( prop ) ) {
24
24
if ( newObj [ prop ] !== oldObj [ prop ] ) {
You can’t perform that action at this time.
0 commit comments