Skip to content

Commit

Permalink
Prevent web crash from Input getting an SDL_WINDOWEVENT before it is …
Browse files Browse the repository at this point in the history
…Initialized.
  • Loading branch information
SirNate0 committed Nov 30, 2023
1 parent 011843e commit 4655979
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Urho3D/Input/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,8 @@ void Input::HandleSDLEvent(void* sdlEvent)
break;

case SDL_WINDOWEVENT:
// Emscripten has a WINDOWEVENT before Input::Initialize() is called from HandleScreenMode().
if (graphics_ || (graphics_ = GetSubsystem<Graphics>()))
{
switch (evt.window.event)
{
Expand Down

0 comments on commit 4655979

Please sign in to comment.