From fd38ed9b2c6d04f048c63c9e54690c8d5d954fa2 Mon Sep 17 00:00:00 2001 From: Vipul Cariappa Date: Mon, 11 May 2026 10:04:39 +0200 Subject: [PATCH] fix GetActualClass for null --- clingwrapper/src/clingwrapper.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clingwrapper/src/clingwrapper.cxx b/clingwrapper/src/clingwrapper.cxx index ed86d729..861eb34a 100644 --- a/clingwrapper/src/clingwrapper.cxx +++ b/clingwrapper/src/clingwrapper.cxx @@ -949,10 +949,12 @@ class AutoCastRTTI { Cppyy::TCppScope_t Cppyy::GetActualClass(TCppScope_t klass, TCppObject_t obj) { std::lock_guard Lock(InterOpMutex); - if (!Cpp::IsClassPolymorphic(klass)) + if (!obj || !Cpp::IsClassPolymorphic(klass)) return klass; const std::type_info *typ = &typeid(*(AutoCastRTTI *)obj); + if (!typ) + return klass; std::string mangled_name = typ->name(); std::string demangled_name = Cpp::Demangle(mangled_name);