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
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();
}