From 5a22ef7e61c13af8810f22d5ff82b72a606b6e78 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 17 Apr 2019 18:39:00 -0700 Subject: [PATCH] Patching null dereference in AbstractFloatingView.getOpenView() If there is a better solution, bug assignee, please proceed with it. I'll land this immediately, as a lot of tests are broken. Bug: 130739123 Change-Id: Iacdb9adbbf41f1f9de1390c3e7525ee0bd7beda6 --- src/com/android/launcher3/AbstractFloatingView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java index e7d7a69fd6..0e082760ae 100644 --- a/src/com/android/launcher3/AbstractFloatingView.java +++ b/src/com/android/launcher3/AbstractFloatingView.java @@ -182,6 +182,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch protected static T getOpenView( ActivityContext activity, @FloatingViewType int type) { BaseDragLayer dragLayer = activity.getDragLayer(); + if (dragLayer == null) return null; // Iterate in reverse order. AbstractFloatingView is added later to the dragLayer, // and will be one of the last views. for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {