Fixed crash where there is no focus widget in window.

This commit is contained in:
Robert Borzecki committed 2019-07-08 10:03:41 +02:00
1 parent 838b4a6fda
commit fdf231ddfa
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1 +1 @@
set(TOOLCHAIN_PATH "/usr" CACHE INTERNAL "")
set(TOOLCHAIN_PATH "/home/robert/toolchain/gcc-arm-none-eabi-8-2018-q4-major" CACHE INTERNAL "")
+1 -1
View File
@@ -88,7 +88,7 @@ bool Window::onInput( const InputEvent& inputEvent) {
//if focused item didn't handle the key event and it was navigation key
//check if moving focus is possible
gui::Item* newFocusItem = nullptr;
if( !res && inputEvent.state == InputEvent::State::keyReleasedShort ) {
if( (!res) && (focusItem != nullptr ) && (inputEvent.state == InputEvent::State::keyReleasedShort) ) {
switch( inputEvent.keyCode ) {
case KeyCode::KEY_LEFT:
newFocusItem = focusItem->getNavigationItem(gui::NavigationDirection::LEFT);