Unlinked providers STILL shouldn't cause crashes

Bug 13651057

Change-Id: Id7e5ba521ac3f201b1a44f122358ca5af2929e06
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index b7c1704..2f56e62 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -1751,7 +1751,8 @@
                 for (int i = 0; i < N; i++) {
                     AppWidgetId id = mAppWidgetIds.get(i);
                     if (backupTarget.equals(id.host.packageName)
-                            || backupTarget.equals(id.provider.info.provider.getPackageName())) {
+                            || (id.provider != null && backupTarget.equals(
+                                    id.provider.info.provider.getPackageName()))) {
                         serializeAppWidgetId(out, id);
                     }
                 }