Fixed a crash when language file didn't exist
This commit is contained in:
@@ -19,6 +19,9 @@ public class Language {
|
|||||||
InputStream in=this.getClass().getClassLoader().getResourceAsStream(code+".lang");
|
InputStream in=this.getClass().getClassLoader().getResourceAsStream(code+".lang");
|
||||||
if(in==null) in=this.getClass().getClassLoader().getResourceAsStream("/data/"+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
|
// read the language file
|
||||||
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
|
BufferedReader reader=new BufferedReader(new InputStreamReader(in));
|
||||||
for(String line=reader.readLine(); line!=null; line=reader.readLine()) {
|
for(String line=reader.readLine(); line!=null; line=reader.readLine()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user