tdf#134562 Added check for textnode

Change-Id: I0a38de547747f04a61a66c9ef62e59a68c4e1826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98225
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index dbc22de..0bfafc0 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -20,6 +20,7 @@
#include "WriterInspectorTextPanel.hxx"
#include <svx/svxids.hrc>
#include <doc.hxx>
#include <ndtxt.hxx>
#include <docsh.hxx>
#include <wrtsh.hxx>
#include <com/sun/star/text/XTextRange.hpp>
@@ -241,7 +242,7 @@ void WriterInspectorTextPanel::NotifyItemUpdate(const sal_uInt16 nSId,
        case SID_STYLE_FAMILY1:
        case SID_STYLE_FAMILY2:
        {
            if (pDocSh)
            if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode())
            {
                /*
                First check in the property set of Character Styles