diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-05-08 11:08:15 +0200 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-05-09 18:48:29 +0200 |
commit | c6f39e2deedd93ccf52ca5bb4402cabc3e8bdda7 (patch) | |
tree | 17852bf618515435197888cdcaa9fbc998461fb6 /static | |
parent | 227078bc8d1e37d80eab2d50478ec5fc6345a616 (diff) |
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 <stephan.bergmann@allotropia.de>
Diffstat (limited to 'static')
-rw-r--r-- | static/source/unoembindhelpers/PrimaryBindings.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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<css::uno::XInterface* const*>(self.getValue()); auto const copy = std::malloc(sizeof(css::uno::XInterface*)); *static_cast<css::uno::XInterface**>(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)); |