fdo#70812 writerfilter: check for nullptr after dynamic_cast

Happens when we set "no number" in the default para style, which is
already the case for Writer anyway.

(cherry picked from commit 660d761bfeea81c0b76cf08b4c961a2ad8d09a06)

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx

Change-Id: I3b262e633e52e4aae039c55d6edb744e36f0f354
Reviewed-on: https://gerrit.libreoffice.org/6636
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>