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

Commit

Permalink
Merge pull request #266 from spotify/rculbertson/host-status-fix
Browse files Browse the repository at this point in the history
Fix bug where JobStatusCommand can throw NPE
  • Loading branch information
rculbertson committed Nov 4, 2014
2 parents d32811c + 6ef364a commit 28bb910
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ private boolean showStatusesForHosts(final String hostPattern, final Set<JobId>
for (final JobId jobId : Ordering.natural().sortedCopy(jobIds)) {
final JobStatus jobStatus = statuses.get(jobId);

// jobStatus will be null if the job was deleted after we first got the list of job IDs
if (jobStatus == null) {
continue;
}

// Merge hosts without any status into the set of hosts with a reported task status
final Map<String, TaskStatus> taskStatuses = Maps.newTreeMap();
taskStatuses.putAll(jobStatus.getTaskStatuses());
Expand Down

0 comments on commit 28bb910

Please sign in to comment.