Style Edit Page: Apply then Submit causes WicketRuntimeException

Description

Pushing Apply and then Submit on the Style Edit Page causes:

1 org.apache.wicket.WicketRuntimeException: Null object returned for expression: legend.width for setting value: 0 on: StyleInfoImpl[dem]

Mailing list discussion: https://sourceforge.net/p/geoserver/mailman/message/35658949/

The error can be reproduced on the default point style.

The issue is that the Abstract Style Page initializes a model object for the Legend, but effectively only during the constructor call – AbstractStylePage(StyleInfo style). The "apply" button kicks off some logic that nulls out the Legend object if the user didn't provide any legend-related input, but doesn't refresh the page (and thus doesn't re-initialize the legend object).

When the user then pushes submit, the null legend model breaks the form submission.

Environment

None

Status

Assignee

Unassigned

Reporter

Matt Kruszewski

Triage

None

Fix versions

Affects versions

None

Priority

Medium
Configure