Skip to content

Commit 9cb1085

Browse files
authored
DPLExecutorImpl: Return empty string if exception message was null (#816)
1 parent 48488c2 commit 9cb1085

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

src/main/java/com/teragrep/pth_10/executor/DPLExecutorImpl.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,16 @@ public DPLExecutorResult interpret(
180180
while (exception.getCause() != null) {
181181
exception = exception.getCause();
182182
}
183-
return new DPLExecutorResultImpl(DPLExecutorResult.Code.ERROR, exception.getMessage());
183+
184+
final String message;
185+
if (exception.getMessage() == null) {
186+
message = "";
187+
}
188+
else {
189+
message = exception.getMessage();
190+
}
191+
192+
return new DPLExecutorResultImpl(DPLExecutorResult.Code.ERROR, message);
184193
}
185194

186195
LOGGER.debug("queryId <{}> Checking if aggregates are used", queryId);
@@ -236,7 +245,16 @@ public DPLExecutorResult interpret(
236245
while (exception.getCause() != null) {
237246
exception = exception.getCause();
238247
}
239-
return new DPLExecutorResultImpl(DPLExecutorResult.Code.ERROR, exception.getMessage());
248+
249+
final String message;
250+
if (exception.getMessage() == null) {
251+
message = "";
252+
}
253+
else {
254+
message = exception.getMessage();
255+
}
256+
257+
return new DPLExecutorResultImpl(DPLExecutorResult.Code.ERROR, message);
240258
}
241259

242260
LOGGER.debug("queryId <{}> Returning from interpret()", queryId);

0 commit comments

Comments
 (0)