instead of throwing, return undefined in invalid (too short) buffers

master
Dominic Tarr 10 years ago
parent 6639d2d256
commit 5a00978b1b

@ -18,7 +18,12 @@ function read(buf, offset) {
shift += 7 shift += 7
} while (b >= MSB) } while (b >= MSB)
read.bytesRead = counter - offset if(b === undefined) {
read.bytesRead = 0
res = undefined
}
else
read.bytesRead = counter - offset
return res return res
} }

Loading…
Cancel
Save