Merge "Fix NullPointerException when the focused window has no activity" into main