diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-25 20:33:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-26 20:22:07 +0200 |
commit | bbe228404e65cd467832c8d9a5a434325aa7f957 (patch) | |
tree | 5ef3e020fcbc40bb983ce180172c565a35ac2645 | |
parent | 9b5adc3d9842303e00eba8ffd239a4015bf8355b (diff) |
ensure id is valid before use
Change-Id: Id0b5d07bbe3d2095858f9c3773d1acab3eac9636
Reviewed-on: https://gerrit.libreoffice.org/81532
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 2c9064dbf8bc..a2c6bfb64244 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -372,7 +372,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, weld::TreeView&, void) switch (nTypeId) { case static_cast<sal_uInt16>(SwFieldTypesEnum::GetRef): - if (REFFLDFLAG & m_xTypeLB->get_id(nOld).toUInt32()) + if (nOld != -1 && REFFLDFLAG & m_xTypeLB->get_id(nOld).toUInt32()) // the old one stays nFieldDlgFormatSel = m_xFormatLB->get_selected_index(); bName = true; |