cid#1537991 Unchecked return value

Change-Id: I303817f007dd0035e64d15b3f9310a06aab18060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157396
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2023-09-29 08:41:27 +01:00
parent 56c6e1d6f2
commit d282d73792

View File

@@ -38,12 +38,11 @@ namespace {
OUString get_this_libpath() {
static OUString s_uri = []() {
OUString uri;
osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(get_this_libpath), uri);
sal_Int32 i = uri.lastIndexOf('/');
sal_Int32 i = -1;
if (osl::Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(get_this_libpath), uri))
i = uri.lastIndexOf('/');
if (i == -1)
{
throw css::uno::DeploymentException("URI " + uri + " is expected to contain a slash");
}
return uri.copy(0, i);
}();