mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-20 18:18:30 +00:00
tdf#167599: check the result of UNO_QUERY
Not all objects implement XServiceInfo. Any query must either be UNO_QUERY_THROW, or check its result after UNO_QUERY. Change-Id: I8b1d7c719c4a43a4d658957ad5a91181dc265186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188080 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@ -1275,6 +1275,9 @@ void ObjectInspectorTreeHandler::appendServices(uno::Reference<uno::XInterface>
|
||||
return;
|
||||
|
||||
auto xServiceInfo = uno::Reference<lang::XServiceInfo>(xInterface, uno::UNO_QUERY);
|
||||
if (!xServiceInfo)
|
||||
return;
|
||||
|
||||
const uno::Sequence<OUString> aServiceNames(xServiceInfo->getSupportedServiceNames());
|
||||
for (auto const& aServiceName : aServiceNames)
|
||||
{
|
||||
|
Reference in New Issue
Block a user