Fix NoSuchElementException when no devices are found for the targeted push notification.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/7c24d43b Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/7c24d43b Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/7c24d43b Branch: refs/heads/master Commit: 7c24d43b5c8fc95d049ce02bc3bc7dbac69f6587 Parents: 6b9e5ef Author: Michael Russo <[email protected]> Authored: Wed Apr 13 00:15:32 2016 +0200 Committer: Michael Russo <[email protected]> Committed: Wed Apr 13 00:15:32 2016 +0200 ---------------------------------------------------------------------- .../services/notifications/impl/ApplicationQueueManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/7c24d43b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java index 6c28d2f..fb4d64c 100644 --- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java +++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java @@ -207,7 +207,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager { }) .doOnError(throwable -> logger.error("Failed while trying to send notification", throwable)); - processMessagesObservable.toBlocking().last(); // let this run and block the async thread, messages are queued + processMessagesObservable.toBlocking().lastOrDefault(null); // let this run and block the async thread, messages are queued }
