Fixed a crash when language file didn't exist

This commit is contained in:
2019-02-07 22:54:45 +01:00
parent 943e747f8e
commit 8101c65f49
+3
View File
@@ -19,6 +19,9 @@ public class Language {
InputStream in=this.getClass().getClassLoader().getResourceAsStream(code+".lang");
if(in==null) in=this.getClass().getClassLoader().getResourceAsStream("/data/"+code+".lang");
// give up
if(in==null) throw new IOException("Language file not found: "+code);
// read the language file
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
for(String line=reader.readLine(); line!=null; line=reader.readLine()) {