Skip to content

Commit

Permalink
Fixed an NPE when there was no channel attached to a geofence where a…
Browse files Browse the repository at this point in the history
… pokemon was found
  • Loading branch information
CBRSightings committed Oct 25, 2017
1 parent 5b44770 commit f256837
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/notifier/PokeNotificationSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ private void notifyUser(final String userID, final Message message) {
final User user = this.jda.getUserById(userID);
final Thread thread = new Thread(new UserNotifier(user, message, false));
thread.start();
//
// UserNotifier notifier = new UserNotifier(user,message);
// notifier.run();
}

@Override
Expand Down Expand Up @@ -78,7 +75,9 @@ public void run() {
}
}else {
for (GeofenceIdentifier geofenceIdentifier : pokeSpawn.getGeofenceIds()) {
for (PokeChannel channel : config.getPokeChannels(geofenceIdentifier)) {
ArrayList<PokeChannel> channels = config.getPokeChannels(geofenceIdentifier);
if(channels == null) continue;
for (PokeChannel channel : channels) {
postToChannel(channel,pokeSpawn);
}
}
Expand Down

0 comments on commit f256837

Please sign in to comment.