diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js index b755c2ab..a13a7b3d 100644 --- a/utils/GunSmith/GunSmith.js +++ b/utils/GunSmith/GunSmith.js @@ -288,7 +288,13 @@ const forge = () => { } await new Promise(res => { currentGun.on('message', msg => { - if (msg.type === 'init') { + if (typeof msg !== 'object') { + throw new Error(`msg.type !== object`) + } + + const message = /** @type {{type: string}} */ (msg) + + if (message.type === 'init') { // @ts-ignore res() }