================
@@ -84,8 +84,13 @@ serializeLocation(const Location &Loc,
   return LocationObj;
 }
 
+/// \param Comment A json::Array possibly containing TextComments
+/// \param Key     The type (Brief, Code) of comment to be inserted
 static void insertComment(Object &Description, json::Value &Comment,
                           StringRef Key) {
+  auto *TextCommentArray = Comment.getAsArray();
+  if (TextCommentArray && TextCommentArray->empty())
----------------
ilovepi wrote:

```suggestion
  if (!TextCommentArray || TextCommentArray->empty())
```
Is this more along the lines of what you're after? Return early if we don't get 
something valid back?

https://github.com/llvm/llvm-project/pull/169087
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to