For -filetype=null, NVPTXTargetStreamer is not created, so the return value of OutStreamer->getTargetStreamer() should be checked before calling the methods.
This fixes a crash in llvm/test/tools/llc/binutils-version.ll when LLVM is built with nvptx64-nvidia-cuda as a default target.