From d6ce7fe3d4b5fbc2a49207112fe4e88627aa9af4 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sat, 19 Feb 2011 16:42:44 +0000 Subject: Android: Fix some race conditions and crashes on startup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29341 a1c6a512-1295-4272-9138-f99709370657 --- apps/hosted/notification.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps') diff --git a/apps/hosted/notification.c b/apps/hosted/notification.c index fa8c286..4dd1bec 100644 --- a/apps/hosted/notification.c +++ b/apps/hosted/notification.c @@ -83,6 +83,11 @@ void notification_init(void) "fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;"); NotificationManager_instance = e->GetObjectField(env_ptr, RockboxService_instance, nNM); + if (NotificationManager_instance == NULL) + { + DEBUGF("Failed to get RunForegroundManager instance. Performance will be bad"); + return; + } jclass class = e->GetObjectClass(env_ptr, NotificationManager_instance); updateNotification = e->GetMethodID(env_ptr, class, "updateNotification", -- cgit v1.1