From b57c7975e3810e632f2237c53d0e9fcc12605153 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 27 Jul 2020 02:17:55 +0200 Subject: [PATCH] obs/gs/helper: Throw exception if we aren't in a context --- source/obs/gs/gs-helper.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/obs/gs/gs-helper.hpp b/source/obs/gs/gs-helper.hpp index 437920fc..ccb12f9c 100644 --- a/source/obs/gs/gs-helper.hpp +++ b/source/obs/gs/gs-helper.hpp @@ -28,6 +28,8 @@ namespace gs { inline context() { obs_enter_graphics(); + if (gs_get_context() == nullptr) + throw std::runtime_error("Failed to enter graphics context."); } ~context() {