sw/source/ui/fldui/fldref.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bbe228404e65cd467832c8d9a5a434325aa7f957
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Oct 25 20:33:26 2019 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Oct 26 20:22:07 2019 +0200

    ensure id is valid before use
    
    Change-Id: Id0b5d07bbe3d2095858f9c3773d1acab3eac9636
    Reviewed-on: https://gerrit.libreoffice.org/81532
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to