Binding null value enums

Bug #524689 reported by Paweusz
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Medium
Nicolas Leroux
1.1
Fix Committed
Medium
Unassigned

Bug Description

In play.data.binding.Binder you have such code beginning at line 78:

            // Enums
            if (Enum.class.isAssignableFrom(clazz)) {
                if (value == null || value.length == 0) {
                    return MISSING;
                }
                return Enum.valueOf(clazz, value[0]);
            }

It works fine until one wants to pass null value for enum from html form. In that situation value[0] would contain empty string which causes "No enum const " exception. This in turn causes #{ifErrors} tag to return true.

Revision history for this message
Thilo Tanner (ttanner) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.