From 15abe70fc6da2b58b5eb16fccf23b17c6de08248 Mon Sep 17 00:00:00 2001 From: mjk Date: Fri, 19 Mar 2021 22:47:47 +0000 Subject: [PATCH] handle theoretical future failures of wsview_to_char --- plugins/windows-notification/api/src/ginvoke.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/windows-notification/api/src/ginvoke.cpp b/plugins/windows-notification/api/src/ginvoke.cpp index 407c18b3..9641ce1f 100644 --- a/plugins/windows-notification/api/src/ginvoke.cpp +++ b/plugins/windows-notification/api/src/ginvoke.cpp @@ -20,6 +20,8 @@ namespace glib::impl if (not wmsg.empty()) { ptr = wsview_to_char(wmsg); + if (not ptr) + throw 42; std::string msg{ptr}; g_free(const_cast(ptr)); // WTF? Deletion is not modification! return {{ e.code(), {std::move(msg)} }};