From c6f39e2deedd93ccf52ca5bb4402cabc3e8bdda7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 8 May 2024 11:08:15 +0200 Subject: Embind: Fix uno_Any.get for null interface values ...which had caused an additional getNull/isNull check for a469aea9c0b532d928cd41e389c9c51de1af06f0 "Emscripten: Towards a working C++ UNO bridge" to fail Change-Id: Ibe87ca05f795253c9ede8cab6f96da8fe4496f87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167344 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- static/source/unoembindhelpers/PrimaryBindings.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'static') diff --git a/static/source/unoembindhelpers/PrimaryBindings.cxx b/static/source/unoembindhelpers/PrimaryBindings.cxx index 4972699178c8..9f9a5cf588d5 100644 --- a/static/source/unoembindhelpers/PrimaryBindings.cxx +++ b/static/source/unoembindhelpers/PrimaryBindings.cxx @@ -370,7 +370,10 @@ EMSCRIPTEN_BINDINGS(PrimaryBindings) auto const ifc = *static_cast(self.getValue()); auto const copy = std::malloc(sizeof(css::uno::XInterface*)); *static_cast(copy) = ifc; - ifc->acquire(); + if (ifc != nullptr) + { + ifc->acquire(); + } emscripten::internal::WireTypePack argv(std::move(copy)); return emscripten::val::take_ownership( _emval_take_value(getTypeId(self.getValueType()), argv)); -- cgit