Add null checks to investigate bug 3275738

Change-Id: I55f83336c5059b7ea6234b9451c60c4c062fdb06
This commit is contained in:
Makoto Onuki 2010-12-15 15:37:37 -08:00
parent 884589fddb
commit ebf0f18cba
1 changed files with 6 additions and 0 deletions

View File

@ -455,7 +455,13 @@ public class WidgetProvider extends AppWidgetProvider {
private static EmailWidget getOrCreateWidget(Context context, int widgetId) {
// Lazily initialize these
if (sContext == null) {
if (context == null) { // STOPSHIP remove this check
throw new RuntimeException("context == null!");
}
sContext = context.getApplicationContext();
if (sContext == null) { // STOPSHIP remove this check
throw new RuntimeException("getApplicationContext() returned null!");
}
sWidgetManager = AppWidgetManager.getInstance(context);
sResolver = context.getContentResolver();
}