Index: GroovyRowResult.java =================================================================== RCS file: /cvs/groovy/groovy/groovy-core/src/main/groovy/sql/GroovyRowResult.java,v retrieving revision 1.2 diff -u -r1.2 GroovyRowResult.java --- GroovyRowResult.java 9 Apr 2006 15:16:53 -0000 1.2 +++ GroovyRowResult.java 6 Jul 2006 08:19:13 -0000 @@ -76,13 +79,20 @@ public Object getProperty(String property) { try { Object value = result.get(property); - if (value == null) { - // with some databases/drivers, the columns names are stored uppercase. - value = result.get(property.toUpperCase()); - if (value == null) - throw new MissingPropertyException(property, GroovyRowResult.class); - } - return (value); + if (value != null) + return value; + // if property exists and value is null, return null + if (result.containsKey(property)) + return null; + // with some databases/drivers, the columns names are stored uppercase. + String propertyUpper = property.toUpperCase(); + value = result.get(propertyUpper); + if (value != null) + return value; + // if property exists and value is null, return null + if (result.containsKey(propertyUpper)) + return null; + throw new MissingPropertyException(property, GroovyRowResult.class); } catch (Exception e) { throw new MissingPropertyException(property, GroovyRowResult.class, e);