Fixed a crash when language file didn't exist

main
Codinget 6 years ago
parent 943e747f8e
commit 8101c65f49
  1. 3
      src/totallynotmalware/i18n/Language.java

@ -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()) {

Loading…
Cancel
Save