summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/treelist/treelist.cxx6
2 files changed, 8 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f548fe152b4f..b6db52c8b87d 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4765,6 +4765,8 @@ void SalInstanceTreeView::set_text(const weld::TreeIter& rIter, const OUString&
OUString SalInstanceTreeView::get_id(const weld::TreeIter& rIter) const
{
const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
+ if (!rVclIter.iter)
+ return OUString();
const OUString* pStr = static_cast<const OUString*>(rVclIter.iter->GetUserData());
if (pStr)
return *pStr;
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 8f51e343fd98..fc81fa2eaa0c 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -102,6 +102,8 @@ bool SvTreeList::IsEntryVisible( const SvListView* pView, SvTreeListEntry* pEntr
sal_uInt16 SvTreeList::GetDepth( const SvTreeListEntry* pEntry ) const
{
+ if (!pEntry)
+ return 0;
DBG_ASSERT(pEntry && pEntry!=pRootItem.get(),"GetDepth:Bad Entry");
sal_uInt16 nDepth = 0;
while( pEntry && pEntry->pParent != pRootItem.get() )
@@ -1502,6 +1504,8 @@ SvTreeListEntries& SvTreeList::GetChildList( SvTreeListEntry* pParent )
const SvTreeListEntry* SvTreeList::GetParent( const SvTreeListEntry* pEntry ) const
{
+ if (!pEntry)
+ return nullptr;
const SvTreeListEntry* pParent = pEntry->pParent;
if (pParent == pRootItem.get())
pParent = nullptr;
@@ -1510,6 +1514,8 @@ const SvTreeListEntry* SvTreeList::GetParent( const SvTreeListEntry* pEntry ) co
SvTreeListEntry* SvTreeList::GetParent( SvTreeListEntry* pEntry )
{
+ if (!pEntry)
+ return nullptr;
SvTreeListEntry* pParent = pEntry->pParent;
if (pParent == pRootItem.get())
pParent = nullptr;