Fixing NPE in LauncherAppWidgetHostView, issue 5270711

Change-Id: Iefe70bc362e2a6540b497412f349e15d9a3120cb
This commit is contained in:
Adam Cohen committed 2011-09-11 18:05:58 -07:00
1 parent b5ba097015
commit 0913896b98
1 file changed
+7 -3
@@ -118,9 +118,13 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView {
@Override
public void setAppWidget(int appWidgetId, AppWidgetProviderInfo info) {
super.setAppWidget(appWidgetId, info);
// We add necessary padding to the AppWidgetHostView
Launcher.Padding padding = mLauncher.getPaddingForWidget(info.provider);
setPadding(padding.left, padding.top, padding.right, padding.bottom);
// Sometimes the AppWidgetManager returns a null AppWidgetProviderInfo object for
// a widget, eg. for some widgets in safe mode.
if (info != null) {
// We add necessary padding to the AppWidgetHostView
Launcher.Padding padding = mLauncher.getPaddingForWidget(info.provider);
setPadding(padding.left, padding.top, padding.right, padding.bottom);
}
}
@Override