Commit c2e7256c authored by Bert Leunis's avatar Bert Leunis

HIPPLUG-1287 prevent NPE when radioboxes field is required but no item is yet selected

parent d2458184
/*
* Copyright 2010-2013 Hippo B.V. (http://www.onehippo.com)
* Copyright 2010-2016 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -158,10 +158,11 @@ public class RadioGroupPlugin extends AbstractChoicePlugin {
}
protected ListItem getValueItem(IModel<?> model) {
String key;
key = model.getObject().toString();
ListItem selectedListItem = getValueList().getListItemByKey(key);
return selectedListItem;
if(model == null || model.getObject() == null) {
return null;
}
final String key = model.getObject().toString();
return getValueList().getListItemByKey(key);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment