Commit e226f00
authored
Support usage when size = 0
I got an error when encoding an empty message (`{}`).
When the message is empty, the size is 0 and `slab` is null, so`slice.call(slab, offset, offset += size);` gave me
```
Uncaught TypeError: Method get TypedArray.prototype.subarray called on incompatible receiver null
```
Adding this solved the issue for me. Please correct me if I was using it all wrong. 😂1 parent bfac0ea commit e226f00
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments