tdf#120703 PVS: Avoid dereferencing nullptr

V595 The 'pEndIdx' pointer was utilized before it was verified against nullptr.
     Check lines: 1328, 1347.

Change-Id: If9aff472e6ec7429ef2055b44dd11e62d4489ba4
Reviewed-on: https://gerrit.libreoffice.org/71458
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 8404629..ac20908 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1458,7 +1458,7 @@
{
    // illegal range ??
    if(rStt.GetIndex() > rEnd.GetIndex()
        || (rStt == rEnd && (!pSttIdx || pSttIdx->GetIndex() >= pEndIdx->GetIndex())))
        || (rStt == rEnd && (!pSttIdx || !pEndIdx || pSttIdx->GetIndex() >= pEndIdx->GetIndex())))
        return;
    SwDoc* const pDoc = rStt.GetNode().GetDoc();