changeset 6182:95257f28bb3f

Accept null mode in to/fromValue
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 04 Jun 2013 16:02:17 +0200 (2013-06-04)
parents 65f278bd4ef5
children 3f8f212253a0
files artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Tue Jun 04 16:01:43 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Tue Jun 04 16:02:17 2013 +0200
@@ -234,11 +234,7 @@
         Object locations = args.get(1);
         Object from      = args.get(2);
 
-        if (!(mode instanceof String)){
-            return -FAR_AWAY;
-        }
-
-        if (mode.equals("locations")) {
+        if (mode instanceof String && mode.equals("locations")) {
             if (!(locations instanceof String)) {
                 return -FAR_AWAY;
             }
@@ -283,11 +279,7 @@
         Object locations = args.get(1);
         Object to        = args.get(2);
 
-        if (!(mode instanceof String)){
-            return FAR_AWAY;
-        }
-
-        if (mode.equals("locations")) {
+        if (mode instanceof String && mode.equals("locations")) {
             if (!(locations instanceof String)) {
                 return FAR_AWAY;
             }

http://dive4elements.wald.intevation.org