PrismarineJS/prismarine-chat

RangeError: Invalid string length crash

Closed this issue · 1 comments

whenever {"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"translate": "%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s%1$s","with": [{"text":"a","color":"dark_red","bold":true,"italic":true,"strikethrough":true,"underlined":true,"obfuscated":true}]}]}]}]}]}]}]}
is tellrawed to the bot it will crash it with the error

RangeError: Invalid string length
    at String.replace (<anonymous>)
    at format (/home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/format.js:6:17)
    at ChatMessage.toString (/home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:308:20)
    at /home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:306:47
    at Array.map (<anonymous>)
    at ChatMessage.toString (/home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:306:28)
    at /home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:306:47
    at Array.map (<anonymous>)
    at ChatMessage.toString (/home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:306:28)
    at /home/parker/FNFBoyfriendBot-Custom-Build/node_modules/prismarine-chat/index.js:306:47

i tried fixing this myself and the issue persists

Fixed in 1.10.1 with npm update