Skip to content

Commit

Permalink
Load message strings first
Browse files Browse the repository at this point in the history
 - fixes NPE on first startup (solution by IPPF user Neo028)
  • Loading branch information
olistudent committed May 26, 2013
1 parent 2080c65 commit f795fd5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/de/FBEditor/FBEdit.java
Expand Up @@ -117,17 +117,13 @@ public FBEdit() {
pane = new JTextPane2();

setProperties(properties);
if (!(loadProp)) {
getHost(true);
getPassword(true);
}

// load supported languages
loadLanguages();

Debug.always("OS Language: " + System.getProperty("user.language"));
Debug.always("OS Country: " + System.getProperty("user.country"));
if (language == null || language.equals("")) {
if (language == null || language.equals(false)) {
Debug.info("No language set yet ... Setting language to OS language");
// Check if language is supported. If not switch to English
if (supported_languages.contains(new Locale(System
Expand All @@ -147,6 +143,11 @@ public FBEdit() {
language.substring(language.indexOf("_") + 1, language.length())));

fileName = FBEdit.getMessage("main.unknown_file");

if (!(loadProp)) {
getHost(true);
getPassword(true);
}

undoManager = new CompoundUndoManager(pane);
action = new ActionListen(this);
Expand Down

0 comments on commit f795fd5

Please sign in to comment.