From 2dbd6efe61b456a841fd2e5d7b922ec5dc151ffc Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Thu, 3 Nov 2016 22:34:57 +0100 Subject: [PATCH] throw instead of returning undefined --- decode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decode.js b/decode.js index 4482a39..67768be 100644 --- a/decode.js +++ b/decode.js @@ -15,7 +15,7 @@ function read(buf, offset) { if(counter >= l) { read.bytes = 0 read.bytesRead = 0 // DEPRECATED - return undefined + throw new Error('Could not decode varint') } b = buf[counter++] res += shift < 28