diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index f977119801..87e180dd24 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -438,12 +438,16 @@ public: //============================================================================== bool isFocused() const override { - return view.callBooleanMethod (ComponentPeerView.hasFocus); + if (view != nullptr) + return view.callBooleanMethod (ComponentPeerView.hasFocus); + + return false; } void grabFocus() override { - view.callBooleanMethod (ComponentPeerView.requestFocus); + if (view != nullptr) + view.callBooleanMethod (ComponentPeerView.requestFocus); } void handleFocusChangeCallback (bool hasFocus)