From f256837c9efd89c7d364e9d2afe8c826b3e903fb Mon Sep 17 00:00:00 2001 From: CBRSightings Date: Wed, 25 Oct 2017 22:27:18 +1100 Subject: [PATCH] Fixed an NPE when there was no channel attached to a geofence where a pokemon was found --- src/notifier/PokeNotificationSender.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/notifier/PokeNotificationSender.java b/src/notifier/PokeNotificationSender.java index f7b95c3..ef7e3a6 100644 --- a/src/notifier/PokeNotificationSender.java +++ b/src/notifier/PokeNotificationSender.java @@ -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 @@ -78,7 +75,9 @@ public void run() { } }else { for (GeofenceIdentifier geofenceIdentifier : pokeSpawn.getGeofenceIds()) { - for (PokeChannel channel : config.getPokeChannels(geofenceIdentifier)) { + ArrayList channels = config.getPokeChannels(geofenceIdentifier); + if(channels == null) continue; + for (PokeChannel channel : channels) { postToChannel(channel,pokeSpawn); } }