mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Make nextString throw a JSONException instead of a NumberFormatException for malformed input.
This commit is contained in:
parent
612dafc750
commit
dfa651e777
@ -278,7 +278,11 @@ public class JSONTokener {
|
||||
sb.append('\r');
|
||||
break;
|
||||
case 'u':
|
||||
sb.append((char)Integer.parseInt(this.next(4), 16));
|
||||
try {
|
||||
sb.append((char)Integer.parseInt(this.next(4), 16));
|
||||
} catch (NumberFormatException e) {
|
||||
throw this.syntaxError("Illegal escape.");
|
||||
}
|
||||
break;
|
||||
case '"':
|
||||
case '\'':
|
||||
|
Loading…
x
Reference in New Issue
Block a user