[index] Ignore invalid ObjC categories.

We currently are unable to get a USR for those and it doesn't seem useful to try to index them.

llvm-svn: 291705
diff --git a/clang/lib/Index/IndexDecl.cpp b/clang/lib/Index/IndexDecl.cpp
index 6c5b2e5..7d60aad 100644
--- a/clang/lib/Index/IndexDecl.cpp
+++ b/clang/lib/Index/IndexDecl.cpp
@@ -289,11 +289,12 @@
 
   bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) {
     const ObjCInterfaceDecl *C = D->getClassInterface();
-    if (C)
-      TRY_TO(IndexCtx.handleReference(C, D->getLocation(), D, D,
-                                  SymbolRoleSet(), SymbolRelation{
-                                    (unsigned)SymbolRole::RelationExtendedBy, D
-                                  }));
+    if (!C)
+      return true;
+    TRY_TO(IndexCtx.handleReference(C, D->getLocation(), D, D, SymbolRoleSet(),
+                                   SymbolRelation{
+                                     (unsigned)SymbolRole::RelationExtendedBy, D
+                                   }));
     SourceLocation CategoryLoc = D->getCategoryNameLoc();
     if (!CategoryLoc.isValid())
       CategoryLoc = D->getLocation();