From 35d3184af4121b24ae7c70f5f05236d5e7d99ffb Mon Sep 17 00:00:00 2001 From: Congiary <66987756+Congiary@users.noreply.github.com> Date: Thu, 5 Sep 2024 00:53:32 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BA=D1=80=D0=B0=D1=88=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D0=BD=D1=83=D0=BB=D0=B5?= =?UTF-8?q?=D0=B2=D0=BE=D0=B3=D0=BE=20byteArray?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nbt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nbt.js b/nbt.js index f0b754a..18c7279 100644 --- a/nbt.js +++ b/nbt.js @@ -277,6 +277,10 @@ * @param {Array.|Uint8Array|Buffer} value * @returns {module:nbt.Writer} itself */ this[nbt.tagTypes.byteArray] = function(value) { + if(!value) { + console.error('Прилетел null при записи byteArray') + return this; + } this.int(value.length); accommodate(value.length); arrayView.set(value, this.offset); @@ -671,4 +675,4 @@ }); } }; -}).apply(typeof exports !== 'undefined' ? exports : (window.nbt = {})); \ No newline at end of file +}).apply(typeof exports !== 'undefined' ? exports : (window.nbt = {}));