stoc/source/javavm/javavm.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 941213ec206b6ad1374cdbe70cf8ae9891a651ca Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Mar 24 14:44:48 2025 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Mon Mar 24 17:01:58 2025 +0100 Avoid exception when reading nil NetAccess value The NetAccess property in officecfg/registry/schema/org/openoffice/Office/Java.xcs is nillable and has no default value, so reading it here via XRegistryKey::getLongValue would typically have caused an exception (that would have been swallowed in initVMConfiguration, but would have caused the remainder of getJavaPropsFromSafetySettings to be skipped). Change-Id: If53986900917de20366f9517b9eae16227d69cf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183268 Reviewed-by: Stephan Bergmann <[email protected]> Tested-by: Jenkins diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 2d10d3f3876a..3aeb7c33ff3f 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -345,7 +345,8 @@ void getJavaPropsFromSafetySettings( if (xRegistryRootKey.is()) { css::uno::Reference<css::registry::XRegistryKey> key_NetAccess= xRegistryRootKey->openKey(u"VirtualMachine/NetAccess"_ustr); - if (key_NetAccess.is()) + if (key_NetAccess.is() + && key_NetAccess->getValueType() != css::registry::RegistryValueType_NOT_DEFINED) { sal_Int32 val= key_NetAccess->getLongValue(); OUString sVal;
