diff --git a/src/main/java/me/mrnavastar/r/R.java b/src/main/java/me/mrnavastar/r/R.java index 08ecac1..3b0fa4f 100644 --- a/src/main/java/me/mrnavastar/r/R.java +++ b/src/main/java/me/mrnavastar/r/R.java @@ -2,6 +2,7 @@ import java.lang.reflect.*; import java.util.Arrays; +import java.util.Objects; public class R { @@ -114,9 +115,11 @@ public Class[] generics() { try { return Class.forName(t.getTypeName()); } catch (ClassNotFoundException e) { - throw new RuntimeException(e); + return null; } - }).toArray(Class[]::new); + }) + .filter(Objects::nonNull) + .toArray(Class[]::new); } return new Class[]{}; }