COFF: Improve debug helper function.

SectionChunk::getDebugName crashed if the symbol was a nullptr.

llvm-svn: 245677
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index ce2de5c..cbdfd55 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -217,7 +217,9 @@
 }
 
 StringRef SectionChunk::getDebugName() {
-  return Sym->getName();
+  if (Sym)
+    return Sym->getName();
+  return "";
 }
 
 ArrayRef<uint8_t> SectionChunk::getContents() const {