From 3809655e6d554dbc6c74b11597c540c4a62d4c09 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 7 Dec 2017 00:06:36 +0100 Subject: sc: don't crash on loading comments Seems filters call ShowNote before a view is set or something. Fixup for 25555c50ad2a57c1b2313f39b8132ac5e80a45fd. Change-Id: I9a69bf28b17cb16df7f1b1d06d9d3168da4a34b5 Reviewed-on: https://gerrit.libreoffice.org/46000 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- sc/source/ui/docshell/docfunc.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 16b0a61aed51..939c54614d78 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1216,7 +1216,8 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow ) ScTabView::OnLOKNoteStateChanged(pNote); - ScDocShell::GetViewData()->GetScDrawView()->SyncForGrid(pNote->GetCaption()); + if (ScDocShell::GetViewData()) + ScDocShell::GetViewData()->GetScDrawView()->SyncForGrid(pNote->GetCaption()); rDocShell.SetDocumentModified(); return true; -- cgit