getMapValue throws exception
Posted: 26 Jun 2014 12:54
The function "getMapValue(Map map, String key, Object default)" throws an exception when 'map' is null.
In my opinion the variant of the function with a default value should return that default value when the map does not exist.
More like treating a 'null' like an empty map instead of throwing an exception
That would simplify some flows because no check is needed if the map variable actually exists.
Using "mapVar = addMapEntry(mapVar, 'key', value)" should also work without exception when mapVar is null or does not yet exist.
In my opinion the variant of the function with a default value should return that default value when the map does not exist.
More like treating a 'null' like an empty map instead of throwing an exception

That would simplify some flows because no check is needed if the map variable actually exists.
Using "mapVar = addMapEntry(mapVar, 'key', value)" should also work without exception when mapVar is null or does not yet exist.