Skip to content

Commit e583efc

Browse files
authored
fix: handle undefined hash in socket message handler (#19)
1 parent 48c3370 commit e583efc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client-src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,13 @@ var onSocketMessage = {
243243
sendMessage("Invalid");
244244
},
245245
/**
246-
* @param {string} hash
246+
* @param {string | undefined} _hash
247247
*/
248248
hash: function hash(_hash) {
249+
if (!_hash) {
250+
return;
251+
}
252+
249253
status.previousHash = status.currentHash;
250254
status.currentHash = _hash;
251255
},

0 commit comments

Comments
 (0)