From 89b256f431c09097dd7bf3d163430ec54a7d9260 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 14 Oct 2014 13:43:43 +0100 Subject: coverity#1242430 Dereference after null check Change-Id: If1c59d6d06a9e4601731f13a69b1ac2603c0014b --- sc/source/ui/miscdlgs/datafdlg.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sc') diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 8a5f2324ed0c..0d3f58d4fda0 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -209,14 +209,13 @@ ScDataFormDlg::~ScDataFormDlg() void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) { - OUString aFieldName; for (sal_uInt16 i = 0; i < aColLength; ++i) { if (!maEdits.is_null(i)) { - if (nCurrentRow<=nEndRow) + if (nCurrentRow<=nEndRow && pDoc) { - aFieldName = pDoc->GetString(i + nStartCol, nCurrentRow, nTab); + OUString aFieldName(pDoc->GetString(i + nStartCol, nCurrentRow, nTab)); maEdits[i].SetText(aFieldName); } else -- cgit