diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-11-24 09:48:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-11-24 09:48:20 +0000 |
commit | 3bd11c5427cf1306e14fdc84a07f01778c46d3c5 (patch) | |
tree | a3aab7d4eb0d203367664ee77e73d319c392cce4 /sw/source/ui | |
parent | 1f449db6fa1a4adde9d40742c7d1d79a17c4fdac (diff) |
cppcheck: Possible null pointer dereference
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/frmdlg/wrap.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index ba50426e04aa..60cdc1a43ed3 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -646,10 +646,15 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) else if (pEdit == &aBottomMarginED) pOpposite = &aTopMarginED; - sal_Int64 nOpposite = pOpposite->GetValue(); + OSL_ASSERT(pOpposite); - if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) - pOpposite->SetValue(pOpposite->GetMax() - nValue); + if (pOpposite) + { + sal_Int64 nOpposite = pOpposite->GetValue(); + + if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) + pOpposite->SetValue(pOpposite->GetMax() - nValue); + } } return 0; |