summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-04-04 16:47:03 +0000
committermatthijs <matthijs@openttd.org>2005-04-04 16:47:03 +0000
commit00c819c0d5e2e64717d6c7968f477cb4642a94d5 (patch)
treebcfa1105074f423e47db2457e639220a5377d0de
parentb2c754320481f47a7c3a74a652d53b73bd55c43b (diff)
downloadopenttd-00c819c0d5e2e64717d6c7968f477cb4642a94d5.tar.xz
(svn r2146) - Fix: [ 1175973 ] Crash if any key is pressed in startup (pkirchhofer)
-rw-r--r--window.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/window.c b/window.c
index b9d46a53a..becc44d11 100644
--- a/window.c
+++ b/window.c
@@ -1280,8 +1280,11 @@ static void HandleKeypress(uint32 key)
break;
}
- if (we.keypress.cont)
- FindWindowById(WC_MAIN_TOOLBAR, 0)->wndproc(w, &we);
+ if (we.keypress.cont) {
+ w = FindWindowById(WC_MAIN_TOOLBAR, 0);
+ // When there is no toolbar w is null, check for that
+ if (w != NULL) w->wndproc(w, &we);
+ }
}
extern void UpdateTileSelection(void);