Fix widget stopListening NPE.

lookupHostLocked caller needs to check for null return value.
This commit is contained in:
Ken Shirriff
2009-09-23 16:42:53 -07:00
parent d4c00a173a
commit e21167a9e5

View File

@ -473,8 +473,10 @@ class AppWidgetService extends IAppWidgetService.Stub
public void stopListening(int hostId) {
synchronized (mAppWidgetIds) {
Host host = lookupHostLocked(getCallingUid(), hostId);
host.callbacks = null;
pruneHostLocked(host);
if (host != null) {
host.callbacks = null;
pruneHostLocked(host);
}
}
}