summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/namedlg/namedlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/namedlg/namedlg.cxx')
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index a6a182cd82..2501672378 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -306,8 +306,8 @@ void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
void ScNameDlg::AddPushed()
{
mbCloseWithoutUndo = true;
- ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
- pViewSh->SwitchBetweenRefDialogs(this);
+ if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell())
+ pViewSh->SwitchBetweenRefDialogs(this);
}
void ScNameDlg::SetEntry(const OUString& rName, const OUString& rScope)