[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Fri Nov 7 13:04:39 PST 2014


 sc/source/ui/namedlg/namedefdlg.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit bbdecd902bf2844d781dc1550a1d24bcac80b260
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Nov 7 21:34:52 2014 +0100

    coverity#735814 Explicit null dereferenced
    
    Change-Id: I7c6ebe65cd8c3364b541b5545ab36a13d155a61c

diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 214bfb1..43b4ecc 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -237,8 +237,10 @@ void ScNameDefDlg::AddPushed()
                     if (!mpDoc->GetTable(aScope, nTab))
                         nTab = -1;
 
-                    mpDocShell->GetUndoManager()->AddUndoAction(
-                            new ScUndoAddRangeData( mpDocShell, pNewEntry, nTab) );
+                    assert( pNewEntry);     // undo of no insertion smells fishy
+                    if (pNewEntry)
+                        mpDocShell->GetUndoManager()->AddUndoAction(
+                                new ScUndoAddRangeData( mpDocShell, pNewEntry, nTab) );
 
                     // set table stream invalid, otherwise RangeName won't be saved if no other
                     // call invalidates the stream


More information about the Libreoffice-commits mailing list