aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeak3d <pfau@peak3d.de>2018-11-15 09:02:29 +0100
committerpeak3d <pfau@peak3d.de>2018-11-15 09:02:29 +0100
commit34dcbc9896212508cd7a516fe91453e91e37d932 (patch)
treea7efee3a8b73d1a5f96e6121248f0120cae8b216
parent352b5e0d26ed2144109be68391c76ec4f4a599da (diff)
[Android] check for valid winsystem when dispatching events
-rw-r--r--xbmc/platform/android/activity/AndroidKey.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/xbmc/platform/android/activity/AndroidKey.cpp b/xbmc/platform/android/activity/AndroidKey.cpp
index 5cc7b8b9d3..1d5f17e82f 100644
--- a/xbmc/platform/android/activity/AndroidKey.cpp
+++ b/xbmc/platform/android/activity/AndroidKey.cpp
@@ -312,6 +312,10 @@ bool CAndroidKey::onKeyboardEvent(AInputEvent *event)
void CAndroidKey::XBMC_Key(uint8_t code, uint16_t key, uint16_t modifiers, uint16_t unicode, bool up)
{
+ CWinSystemAndroid* winSystem(dynamic_cast<CWinSystemAndroid*>(CServiceBroker::GetWinSystem()));
+ if (!winSystem)
+ return;
+
XBMC_Event newEvent;
memset(&newEvent, 0, sizeof(newEvent));
@@ -323,5 +327,5 @@ void CAndroidKey::XBMC_Key(uint8_t code, uint16_t key, uint16_t modifiers, uint1
newEvent.key.keysym.mod = (XBMCMod)modifiers;
//CXBMCApp::android_printf("XBMC_Key(%u, %u, 0x%04X, %d)", code, key, modifiers, up);
- dynamic_cast<CWinSystemAndroid*>(CServiceBroker::GetWinSystem())->MessagePush(&newEvent);
+ winSystem->MessagePush(&newEvent);
}