From def8353ca330a741cb00b050030fe659ed9e4a7f Mon Sep 17 00:00:00 2001 From: Kata Zavorotchenko Date: Wed, 14 Aug 2019 04:52:07 -0700 Subject: [PATCH] TypeSpec creation fallback Summary: For the cases when we can't resolve PsiClassType.resolve() use the fallback method to create the simple TypeSpec representation Reviewed By: rahulsbisen Differential Revision: D16803185 fbshipit-source-id: 63428dee4abcb3625c5d7682c817ac5af983aa7b --- .../com/facebook/litho/specmodels/processor/PsiTypeUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litho-intellij-plugin/src/main/java/com/facebook/litho/specmodels/processor/PsiTypeUtils.java b/litho-intellij-plugin/src/main/java/com/facebook/litho/specmodels/processor/PsiTypeUtils.java index b39b435e83b..5c5501d5c56 100644 --- a/litho-intellij-plugin/src/main/java/com/facebook/litho/specmodels/processor/PsiTypeUtils.java +++ b/litho-intellij-plugin/src/main/java/com/facebook/litho/specmodels/processor/PsiTypeUtils.java @@ -71,6 +71,9 @@ public TypeSpec visitType(PsiType type) { @Override public TypeSpec visitClassType(PsiClassType classType) { final PsiClass psiClass = classType.resolve(); + if (psiClass == null) { + return visitType(classType); + } // In case of Generic like E extends ..., getQualifiedName() returns null; final String qualifiedName = psiClass.getQualifiedName() != null