Skip to content

Commit

Permalink
fixed crash when unknown probe is requested in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
h0pbeat committed Jan 9, 2016
1 parent c15ff36 commit 57ca1da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion funf_v4/src/main/java/edu/mit/media/funf/FunfManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,12 @@ public void requestData(DataListener listener, JsonElement probeConfig, Schedule
throw new IllegalArgumentException("Probe config cannot be null");
}
// Use schedule in probeConfig @schedule annotation
Probe probe = gson.fromJson(probeConfig, Probe.class);
Probe probe = null;
try {
probe = gson.fromJson(probeConfig, Probe.class);
} catch (NullPointerException e) {
return;
}
probe.addStateListener(probeStateListener);
if (schedule == null) {
DefaultSchedule defaultSchedule = probe.getClass().getAnnotation(DefaultSchedule.class);
Expand Down

0 comments on commit 57ca1da

Please sign in to comment.