svx/source/gallery2/galbrws1.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e53df700aa6d50003cd86d3190a3e4348f66e240
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Sep 10 20:04:18 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Sep 11 09:37:52 2024 +0200

    cid#1619294 Dereference null return value
    
    Change-Id: I07246237df3ebd6040353938984622e530b9ce2e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173146
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 960b9d81d862..e367101fb759 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -287,7 +287,12 @@ void GalleryBrowser1::ImplGalleryThemeProperties( 
std::u16string_view rThemeName
 {
     DBG_ASSERT(!mpThemePropsDlgItemSet, "mpThemePropsDlgItemSet already set!");
     mpThemePropsDlgItemSet.reset(new SfxItemSet( SfxGetpApp()->GetPool() ));
-    GalleryTheme*   pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
+    GalleryTheme* pTheme = mpGallery->AcquireTheme( rThemeName, 
maLocalListener );
+    if (!pTheme)
+    {
+        SAL_WARN("svx", "failed to acquire theme: " << OUString(rThemeName));
+        return;
+    }
 
     ImplFillExchangeData(*pTheme, *mpExchangeData);
 

Reply via email to