Skip to content

Commit

Permalink
Avoid failing if environment does not provide platform string
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 committed Sep 5, 2023
1 parent a95fe0f commit 0a4f63c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/mahomaps/MahoMapsApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class MahoMapsApp extends MIDlet implements Runnable, CommandListener {
public static String[] text;

// info cache
public static final String platform = System.getProperty("microedition.platform");
public static boolean bb = platform.toLowerCase().indexOf("blackberry") != -1;
public static final String platform;
public static final boolean bb;
public static String version;
public static String commit;
public static boolean paused;
Expand All @@ -62,6 +62,15 @@ public class MahoMapsApp extends MIDlet implements Runnable, CommandListener {
public static Command yes;
public static Command toMap;

static {
platform = System.getProperty("microedition.platform");
if (platform == null) {
bb = false;
} else {
bb = platform.toLowerCase().indexOf("blackberry") != -1;
}
}

public MahoMapsApp() {
display = Display.getDisplay(this);
}
Expand Down

0 comments on commit 0a4f63c

Please sign in to comment.