Skip to content

Commit 26ebcac

Browse files
thelsingadrienbaron
authored andcommitted
check for none type
1 parent adf578e commit 26ebcac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,14 @@ public static boolean isMethodVisibleInJS(ExecutableElement method) {
185185
* Optional}
186186
*/
187187
public static Optional<TypeElement> getSuperComponentType(TypeElement component) {
188-
// If super type is vue component, don't return it
189-
if (TypeName.get(Object.class).equals(TypeName.get(component.getSuperclass()))) {
188+
// If super type is Object or "none" ignore it
189+
TypeMirror mirror = component.getSuperclass();
190+
if ( mirror.getKind() == TypeKind.NONE
191+
|| TypeName.get(Object.class).equals(TypeName.get(mirror))) {
190192
return Optional.empty();
191193
}
192194

193-
return Optional.of((TypeElement) ((DeclaredType) component.getSuperclass()).asElement());
195+
return Optional.of((TypeElement) ((DeclaredType) mirror).asElement());
194196
}
195197

196198
/**

0 commit comments

Comments
 (0)