Skip to content
This repository has been archived by the owner on Dec 22, 2019. It is now read-only.

Commit

Permalink
Fix NPE by implicitly assuming the presence of a service URL
Browse files Browse the repository at this point in the history
  • Loading branch information
cmur2 committed Apr 19, 2014
1 parent f171627 commit ea5b092
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/de/mycrobase/jcloudapp/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public static void main(String[] args) throws Exception {
try {
Map<String, String> m =
(Map<String, String>) yaml.load(new FileInputStream(storage));
serviceUrl = URI.create(m.get("service_url"));
// avoid NPE by implicitly assuming the presence of a service URL
if(m.containsKey("service_url")) {
serviceUrl = URI.create(m.get("service_url"));
}
} catch(IOException ex) {
showErrorDialog("Loading settings from .cloudapp-cli failed: "+ex);
System.exit(1);
Expand Down

0 comments on commit ea5b092

Please sign in to comment.