summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-12 14:39:17 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-12 14:39:17 -0400
commit9a884535c39867b7822221406f3f2630e3b95f2a (patch)
tree82b59225e969a576fb97223b3130407af8a2112f /gtk2_ardour/utils.cc
parent6b3907d57f3f69df420529af308412eeb80306a4 (diff)
prevent key press in pre-main-window dialog(s) from crashing the program because there is no editor window to forward key presses to
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 8b05eb7108..1b87a3d444 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -363,8 +363,15 @@ set_color (Gdk::Color& c, int rgb)
bool
relay_key_press (GdkEventKey* ev, Gtk::Window* win)
{
+ PublicEditor& ed (PublicEditor::instance());
+
+ if (&ed == 0) {
+ /* early key press in pre-main-window-dialogs, no editor yet */
+ return false;
+ }
+
if (!key_press_focus_accelerator_handler (*win, ev)) {
- return PublicEditor::instance().on_key_press_event(ev);
+ return ed.on_key_press_event(ev);
} else {
return true;
}