Merge "Add null checks to investigate bug 3275738"

This commit is contained in:
Makoto Onuki 2010-12-15 15:42:19 -08:00 committed by Android (Google) Code Review
commit 2a63ac55e9

View File

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