minor fix
authorjoelbandi <joelvivekbandi@gmail.com>
Mon, 1 Aug 2016 12:44:14 +0000 (05:44 -0700)
committerjoelbandi <joelvivekbandi@gmail.com>
Mon, 1 Aug 2016 12:44:14 +0000 (05:44 -0700)
src/js/iotjs/src/slot.js

index 0a2824bbb258e0ab3f2ad7a2d0b1165e72cc1500..c28354635c3cb463d7077c8aaaa1d46aaec16223 100644 (file)
@@ -26,12 +26,12 @@ var Slot = function () {
                if (prevhmac && prevhmac instanceof Uint8Array) {
                        this.prevhmac = prevhmac;
                } else {
-                       throw new Error("prevhmac input not valid");
+                       this.prevhmac = new Uint8Array(this.HMAC_SIZE);
                }
                if (hmac && hmac instanceof Uint8Array) {
                        this.hmac = hmac;
                } else {
-                       throw new Error("Hmac input not valid");
+                       this.hmac = null;
                }
                this.entries = [];
                this.freespace = this.SLOT_SIZE - getBaseSize(); //???????