summaryrefslogtreecommitdiff
path: root/same/src/main
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-13 19:44:50 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-13 19:45:11 +0100
commit6dee568fc540509656c2c820916a06045c5f7619 (patch)
treec80c0dfde9bba2684fcf7668ef7c995fc20b79f9 /same/src/main
parent1df218cb0cb92ac8374241f342b1b6a0a5fe9e01 (diff)
Make Configuration.getInt() null safe.
Diffstat (limited to 'same/src/main')
-rw-r--r--same/src/main/java/com/orbekk/same/config/Configuration.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/same/src/main/java/com/orbekk/same/config/Configuration.java b/same/src/main/java/com/orbekk/same/config/Configuration.java
index f4cb0cb..75e6ada 100644
--- a/same/src/main/java/com/orbekk/same/config/Configuration.java
+++ b/same/src/main/java/com/orbekk/same/config/Configuration.java
@@ -69,7 +69,10 @@ public class Configuration {
return value;
}
- public int getInt(String name) {
+ public Integer getInt(String name) {
+ if (get(name) == null) {
+ return null;
+ }
return Integer.valueOf(get(name));
}
}