diff options
-rw-r--r-- | static/source/unoembindhelpers/PrimaryBindings.cxx | 5 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.js | 17 |
2 files changed, 21 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)); diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js index 3944f399e3b1..00d9ac68cd3c 100644 --- a/unotest/source/embindtest/embindtest.js +++ b/unotest/source/embindtest/embindtest.js @@ -1027,6 +1027,23 @@ Module.addOnPostRun(function() { outparamindex.delete(); outparam.delete(); } + { + const params1 = new Module.uno_Sequence_any(0, Module.uno_Sequence.FromSize); + const outparamindex = new Module.uno_InOutParam_sequence_short; + const outparam = new Module.uno_InOutParam_sequence_any; + const ret1 = invoke.invoke('getNull', params1, outparamindex, outparam); + console.log(ret1.get()); + const params2 = new Module.uno_Sequence_any([ret1]); + const ret2 = invoke.invoke('isNull', params2, outparamindex, outparam); + console.log(ret2.get()); + console.assert(ret2.get()); + ret1.delete(); + params1.delete(); + ret2.delete(); + params2.delete(); + outparamindex.delete(); + outparam.delete(); + } }); /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |