Skip to content

Commit 0a876ef

Browse files
committed
trim once
1 parent 4ea56dc commit 0a876ef

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

common/src/main/java/org/apache/comet/exceptions/CometQueryExecutionException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public CometQueryExecutionException(String jsonMessage) {
5757
*/
5858
public boolean isJsonMessage() {
5959
String msg = getMessage();
60-
return msg != null && msg.trim().startsWith("{") && msg.trim().endsWith("}");
60+
if (msg == null) return false;
61+
String trimmed = msg.trim();
62+
return trimmed.startsWith("{") && trimmed.endsWith("}");
6163
}
6264
}

0 commit comments

Comments
 (0)