From 27995e638e1582b443befa93bc5dfd5970a38ef2 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 12 Dec 2018 09:18:09 +0000 Subject: [PATCH] tdf#122020 - avoid nullptr deref. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iaa63a90841523061490d207ba5403de26d5c0025 Reviewed-on: https://gerrit.libreoffice.org/65005 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ --- dbaccess/source/ui/control/dbtreelistbox.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 1925a2247c8a..03b87a1b2517 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -183,7 +183,9 @@ IMPL_LINK(DBTreeListBox, OnResetEntry, void*, p, void) // set the flag which allows if the entry can be expanded pEntry->SetFlags( (pEntry->GetFlags() & ~SvTLEntryFlags(SvTLEntryFlags::NO_NODEBMP | SvTLEntryFlags::HAD_CHILDREN)) | SvTLEntryFlags::CHILDREN_ON_DEMAND ); // redraw the entry - GetModel()->InvalidateEntry( pEntry ); + SvTreeList* myModel = GetModel(); + if (myModel) + myModel->InvalidateEntry( pEntry ); } void DBTreeListBox::ModelHasEntryInvalidated( SvTreeListEntry* _pEntry )