From 77d134a3b70c74e08ffc7ab30e10fbf7a7ed4d1e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 24 Nov 2017 16:55:18 +0100 Subject: [PATCH] Fix python error when CrashHandler is opened before opengl is initialised Contributes to #2837 --- cura/CrashHandler.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index c6f94f0a80..85ff5d197d 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -126,13 +126,18 @@ class CrashHandler: return group def _getOpenGLInfo(self): + opengl_instance = OpenGL.getInstance() + if not opengl_instance: + self.data["opengl"] = {"version": "n/a", "vendor": "n/a", "type": "n/a"} + return catalog.i18nc("@label", "not yet initialised
") + info = "" - self.data["opengl"] = {"version": OpenGL.getInstance().getOpenGLVersion(), "vendor": OpenGL.getInstance().getGPUVendorName(), "type": OpenGL.getInstance().getGPUType()} + self.data["opengl"] = {"version": opengl_instance.getOpenGLVersion(), "vendor": opengl_instance.getGPUVendorName(), "type": opengl_instance.getGPUType()} return info