Skip to content

Commit 85a08f1

Browse files
author
Adam Cohen
committed
Attempted fix for issue 7469415
Change-Id: Ica81bf4197dc2c4fadd8fa07cb9c895b55b5702b
1 parent 6f72b1c commit 85a08f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/widget/RemoteViews.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ public void apply(View root, ViewGroup rootParent, final OnClickHandler handler)
351351
public void onClick(View v) {
352352
// Insure that this view is a child of an AdapterView
353353
View parent = (View) v.getParent();
354-
while (!(parent instanceof AdapterView<?>)
354+
while (parent != null && !(parent instanceof AdapterView<?>)
355355
&& !(parent instanceof AppWidgetHostView)) {
356356
parent = (View) parent.getParent();
357357
}
358358

359-
if (parent instanceof AppWidgetHostView) {
359+
if (parent instanceof AppWidgetHostView || parent == null) {
360360
// Somehow they've managed to get this far without having
361361
// and AdapterView as a parent.
362362
Log.e("RemoteViews", "Collection item doesn't have AdapterView parent");

0 commit comments

Comments
 (0)