Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit be51ad2

Browse files
Alexander PatrikalakisAlexander Patrikalakis
authored andcommitted
Fix NPE in Marvel loader's BatchCommand (fixes #290)
1 parent e42c7db commit be51ad2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/amazon/janusgraph/example/MarvelGraphFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public void run() {
203203
command.run();
204204
} catch (Throwable e) {
205205
final Throwable rootCause = ExceptionUtils.getRootCause(e);
206-
final String rootCauseMessage = Optional.ofNullable(rootCause.getMessage()).orElse("");
206+
final String rootCauseMessage = Optional.ofNullable(rootCause).map(Throwable::getMessage).orElse("");
207207
log.error("Error processing comic book {} {}", e.getMessage(), rootCauseMessage, e);
208208
}
209209
if (i++ % BATCH_SIZE == 0) {

0 commit comments

Comments
 (0)