Fix a crash in gotoSrcLine

It appears that DocumentController::openDocument can return a null pointer.
So we should better test for it.
1 job for !128 with git-commit-plugin in 7 minutes and 46 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Build
failed #56905
linux kf5-qt5 qt5.12

00:07:46

 
Name Stage Failure
failed
linux kf5-qt5 qt5.12 Build
[ 29%] Built target kdevqmakecommon
[ 29%] Linking CXX shared module ../../bin/kdevflatpak.so
[ 29%] Built target kdevflatpak
make: *** [Makefile:161: all] Error 2
Uploading artifacts for failed job
Uploading artifacts...
WARNING: JUnitTestResults.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1