Bug 1078182 - "crash in java.lang.NullPointerException: at org.mozilla.search.SearchWidget.addView(SearchWidget.java)" [r=margaret.leibovic]

This commit is contained in:
wesj 2014-10-08 12:26:00 -07:00
parent 1173389da8
commit 1128d5e141

View File

@ -102,8 +102,13 @@ public class SearchWidget extends AppWidgetProvider {
// Utility to create the view for this widget and attach any event listeners to it
private void addView(final AppWidgetManager manager, final Context context, final int id, final Bundle options) {
final int category = options.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, -1);
final boolean isKeyguard = category == AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD;
final boolean isKeyguard;
if (options != null) {
final int category = options.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, -1);
isKeyguard = category == AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD;
} else {
isKeyguard = false;
}
final RemoteViews views;
if (isKeyguard) {