Confluex / Zuul

Keymaster and Gatekeeper - Application Configuration Management
http://confluex.com
Apache License 2.0
42 stars 32 forks source link

Error thrown when settings with null values are rendered as properties #38

Closed mcantrell closed 11 years ago

mcantrell commented 11 years ago
From: Juan Gomez 
Sent: Friday, January 25, 2013 5:55 PM
To: Mike Cantrell
Subject: 

To replicate the issue, create a property with an empty value.

I get this error on the food-safety-qa, when I try to download it:

java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:394)
        at java_util_Map$put.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at java_util_Map$put.call(Unknown Source)
        at org.devnull.zuul.data.model.SettingsGroup$_asType_closure1.doCall(SettingsGroup.groovy:60)
        at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
        at groovy.lang.Closure.call(Closure.java:415)
        at groovy.lang.Closure.call(Closure.java:428)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1351)
        at org.codehaus.groovy.runtime.dgm$170.invoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.devnull.zuul.data.model.SettingsGroup.asType(SettingsGroup.groovy:59)
        at sun.reflect.GeneratedMethodAccessor269.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:793)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:776)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.asType(ScriptBytecodeAdapter.java:587)
        at org.devnull.zuul.web.SettingsServicesController.renderPropertiesByNameAndEnv(SettingsServicesController.groovy:44)
mcantrell commented 11 years ago

fixed in c6d16b36df2db325a6cda9994c26a4ae995f19e5

mcantrell commented 11 years ago

added consistent behavior when converting to Map

3f4e5cba696431002acc784b09014b09fc3ee522