Fix system information crash when OpenGL is not enabled.
authorCarl Hetherington <cth@carlh.net>
Thu, 9 May 2019 11:59:26 +0000 (12:59 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 10 May 2019 22:43:55 +0000 (23:43 +0100)
src/wx/system_information_dialog.cc

index 3a2b3bbf65e7fc1a358677df88c9d683cfc0565e..2630833656a0ee128de2a84f4a90d636a6ee9fee 100644 (file)
@@ -35,7 +35,12 @@ SystemInformationDialog::SystemInformationDialog (wxWindow* parent)
        : TableDialog (parent, _("System information"), 2, 1, false)
 {
        add (_("OpenGL version"), true);
-       add (std_to_wx((char const *) glGetString(GL_VERSION)), false);
+       char const * v = (char const *) glGetString (GL_VERSION);
+       if (v) {
+               add (std_to_wx(v), false);
+       } else {
+               add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false);
+       }
 
        layout ();
 }