diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index c610ccda65..bbcd0980f9 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -945,6 +945,10 @@ bool NativeIsAtTopLevel() { bool NativeTouch(const TouchInput &touch) { if (screenManager) { + // Brute force prevent NaNs from getting into the UI system + if (my_isnan(touch.x) || my_isnan(touch.y)) { + return false; + } screenManager->touch(touch); return true; } else {