Skip to content

Commit 8e9d35c

Browse files
author
Juraj Novák
committed
Fix object casting in ProxyViewHelper
1 parent 13a8d19 commit 8e9d35c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/src/main/java/eu/inloop/viewmodel/ProxyViewHelper.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ public static Class<?> getGenericType(@NonNull Class<?> in, @NonNull Class<?> wh
3434
if (genericSuperclass instanceof ParameterizedType) {
3535
final Type[] typeArgs = ((ParameterizedType) genericSuperclass).getActualTypeArguments();
3636
for (Type arg : typeArgs) {
37-
final Class<?> argClass = (Class<?>) arg;
38-
if (whichExtends.isAssignableFrom(argClass)) {
39-
return argClass;
37+
if (arg instanceof Class<?>) {
38+
final Class<?> argClass = (Class<?>) arg;
39+
if (whichExtends.isAssignableFrom(argClass)) {
40+
return argClass;
41+
}
4042
}
4143
}
4244
}

0 commit comments

Comments
 (0)