Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
fixed null pointer errors in scanners
Browse files Browse the repository at this point in the history
  • Loading branch information
virajith committed Dec 29, 2015
1 parent 090add3 commit 5372a37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,9 @@ public ScanInfoPerBlockPool call() throws IOException {
throttleTimer.start();

try {
result.put(bpid,
compileReport(volume, bpFinalizedDir, bpFinalizedDir, report));
if (bpFinalizedDir != null)
result.put(bpid,
compileReport(volume, bpFinalizedDir, bpFinalizedDir, report));
} catch (InterruptedException ex) {
// Exit quickly and flag the scanner to do the same
result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,16 @@ private String getNextSubDir(String prev, File dir)
}

private String getNextFinalizedDir() throws IOException {
if (bpidDir == null)
return null;

File dir = Paths.get(
bpidDir.getAbsolutePath(), "current", "finalized").toFile();
return getNextSubDir(state.curFinalizedDir, dir);
}

private String getNextFinalizedSubDir() throws IOException {
if (state.curFinalizedDir == null) {
if (state.curFinalizedDir == null || bpidDir == null) {
return null;
}
File dir = Paths.get(
Expand All @@ -609,7 +612,7 @@ private String getNextFinalizedSubDir() throws IOException {
}

private List<String> getSubdirEntries() throws IOException {
if (state.curFinalizedSubDir == null) {
if (state.curFinalizedSubDir == null || bpidDir == null) {
return null; // There are no entries in the null subdir.
}
long now = Time.monotonicNow();
Expand Down

0 comments on commit 5372a37

Please sign in to comment.