Merge "[Overview Sharing] Create the share function for sharing image in overview."
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index ec6e303..985389e 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -175,9 +175,12 @@
                 return;
             }
 
-            InteractionJankMonitorWrapper.begin(
-                    mActivityInterface.getCreatedActivity().getRootView(),
-                    InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
+            final T activity = mActivityInterface.getCreatedActivity();
+            if (activity != null) {
+                InteractionJankMonitorWrapper.begin(
+                        activity.getRootView(),
+                        InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH);
+            }
 
             // Otherwise, start overview.
             mListener = mActivityInterface.createActivityInitListener(this::onActivityReady);