A simple null check would suffice
URL u = MLM.class.getResource("/mazes.txt");
if (u != null) {
...
}
From the javadoc for getResource
Returns:
A URL object or null if no resource with this name is found
A simple null check would suffice
URL u = MLM.class.getResource("/mazes.txt");
if (u != null) {
...
}
From the javadoc for getResource
Returns:
A URL object or null if no resource with this name is found