Prevent crash on decoding truncated json