From e583efc8455be5045b8759c79535a14e049ea7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Florido=20Cifuentes?= Date: Tue, 10 Dec 2024 04:35:49 +0100 Subject: [PATCH] fix: handle undefined hash in socket message handler (#19) --- client-src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client-src/index.js b/client-src/index.js index 5c4ce0a..ba9dcb3 100644 --- a/client-src/index.js +++ b/client-src/index.js @@ -243,9 +243,13 @@ var onSocketMessage = { sendMessage("Invalid"); }, /** - * @param {string} hash + * @param {string | undefined} _hash */ hash: function hash(_hash) { + if (!_hash) { + return; + } + status.previousHash = status.currentHash; status.currentHash = _hash; },