From a99e5e4a253a37b83e6fb48d29568033a0f8e8e2 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sun, 7 Jan 2024 13:18:25 +0100 Subject: [PATCH] fix(VirtualObject): null-check visual before return --- src/vobs/VirtualObject.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vobs/VirtualObject.cc b/src/vobs/VirtualObject.cc index 8a3a638..e99e616 100644 --- a/src/vobs/VirtualObject.cc +++ b/src/vobs/VirtualObject.cc @@ -236,6 +236,11 @@ void ZkVirtualObject_setName(ZkVirtualObject* slf, ZkString name) { ZkVisual* ZkVirtualObject_getVisual(ZkVirtualObject const* slf) { ZKC_TRACE_FN(); ZKC_CHECK_NULL(slf); + + if (!SLF->visual) { + return nullptr; + } + return new ZkVisual(SLF->visual); }