mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
This commit is contained in:
parent
9e9f7dbee2
commit
5034b49c36
|
@ -35,7 +35,18 @@ public class ClasspathResourceReader implements ResourceReader {
|
|||
|
||||
@Override
|
||||
public boolean hasResource(String name) {
|
||||
return classLoader.getResource(name) != null;
|
||||
if (classLoader.getResource(name) == null) {
|
||||
return false;
|
||||
}
|
||||
try (InputStream input = classLoader.getResourceAsStream(name)) {
|
||||
if (input == null) {
|
||||
return false;
|
||||
}
|
||||
input.read();
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user