Don't dereference empty optional
commitd9d9bd65e22a3bd61cce6d88849a794bb0918d7b
authorStephan Bergmann <sbergman@redhat.com>
Mon, 27 Sep 2021 13:18:00 +0000 (27 15:18 +0200)
committerStephan Bergmann <sbergman@redhat.com>
Mon, 27 Sep 2021 15:54:50 +0000 (27 17:54 +0200)
tree3791f19932bb3097bfc7b715eb1647821d22514e
parent089c7d05fde13251eb8cd8daaf7627b6bb0072f9
Don't dereference empty optional

...after 183729b7bdb98561dae2a3e8c9518fe4787ee6e3 "no need to allocate these
SfxItemSet on the heap", as seen causing SIGABRT at

> #1  0x00007f5b61e6a8a4 in abort () at /lib64/libc.so.6
> #2  0x00007f5b30a2414b in std::_Optional_base_impl<SfxItemSet, std::_Optional_base<SfxItemSet, false, false> >::_M_get() const (this=0x7f5ae4f52030) at ~/gcc/trunk/inst/include/c++/12.0.0/optional:443
> #3  0x00007f5b30a219bc in std::optional<SfxItemSet>::operator*() const & (this=0x7f5ae4f52030) at ~/gcc/trunk/inst/include/c++/12.0.0/optional:919
> #4  0x00007f5b30a1eb35 in FlatFndBox::GetItemSet(unsigned short, unsigned short) const (this=0x7f5b337fb730, n_Col=1, n_Row=4) at sw/source/core/doc/docsort.cxx:929

during JunitTest_sw_unoapi_4.

Change-Id: If409ce86863faf4617c636616f814237ff62c7ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122710
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
sw/source/core/doc/docsort.cxx