internal/uidriver/js: bug fix: context might be nil before the loop starts

Closes #1928
This commit is contained in:
Hajime Hoshi 2022-01-03 15:17:26 +09:00
parent b564f239de
commit 02d62aff14

View File

@ -285,6 +285,11 @@ func (u *UserInterface) update() error {
}
func (u *UserInterface) updateImpl(force bool) error {
// context can be nil when an event is fired but the loop doesn't start yet (#1928).
if u.context == nil {
return nil
}
u.input.updateGamepads()
u.input.updateForGo2Cpp()
u.updateSize()