Add an extra check to avoid possible class cast exceptions in getNestedURL
@@ -379,6 +379,8 @@ public class ListedLicenses implements IModelContainer {
public static String getNestedURL(String stringUrl) throws MalformedURLException {
URL url = new URL(stringUrl);
+ String protocol = url.getProtocol();
+ if (protocol.startsWith("http")) {
try {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setInstanceFollowRedirects(false);
@@ -399,6 +401,7 @@ public class ListedLicenses implements IModelContainer {
} catch (Exception e) {
System.out.println(e.getMessage());
}
+ }
return url.toString();
}
