ofz#5471 Null-dereference READ

Change-Id: I5af76b87c3793c7ec7ac41ab25bb4de5d81fc3cf
Reviewed-on: https://gerrit.libreoffice.org/48123
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2018-01-18 12:52:30 +00:00
parent fe5c763250
commit a46ff530d4

View File

@@ -309,7 +309,12 @@ protected:
public:
// Internal
const ESelection& GetSelection() const throw() { CheckSelection( const_cast<SvxUnoTextRangeBase*>(this)->maSelection, mpEditSource->GetTextForwarder() ); return maSelection; };
const ESelection& GetSelection() const throw()
{
const SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr;
CheckSelection(const_cast<SvxUnoTextRangeBase*>(this)->maSelection, pForwarder);
return maSelection;
}
void SetSelection( const ESelection& rSelection ) throw();
void CollapseToStart() throw();