InGamePacketHandler: fixed crash in form handling when invalid JSON is given

This commit is contained in:
Dylan K. Taylor 2022-01-21 17:34:13 +00:00
parent 061d851fbd
commit 56fe71d939
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -880,7 +880,7 @@ class InGamePacketHandler extends PacketHandler{
$fixed = "[" . implode(",", $newParts) . "]";
if(($ret = json_decode($fixed, $assoc)) === null){
throw new \InvalidArgumentException("Failed to fix JSON: " . json_last_error_msg() . "(original: $json, modified: $fixed)");
throw new PacketHandlingException("Failed to fix JSON: " . json_last_error_msg() . "(original: $json, modified: $fixed)");
}
return $ret;