Removing null action throws exception for WebPickerField #PL-4814

This commit is contained in:
Yuriy Artamonov 2015-02-09 15:19:17 +00:00
parent a3534674c5
commit 9d09791d9a
2 changed files with 14 additions and 10 deletions

View File

@ -282,11 +282,13 @@ public class WebPickerField extends WebAbstractField<CubaPickerField> implements
@Override
public void removeAction(Action action) {
actions.remove(action);
actionHandler.removeAction(action);
if (action.getOwner() != null && action.getOwner() instanceof WebButton) {
Button button = ((WebButton) action.getOwner()).getComponent();
component.removeButton(button);
if (action != null) {
actions.remove(action);
actionHandler.removeAction(action);
if (action.getOwner() != null && action.getOwner() instanceof WebButton) {
Button button = ((WebButton) action.getOwner()).getComponent();
component.removeButton(button);
}
}
}

View File

@ -351,11 +351,13 @@ public class WebPickerField
@Override
public void removeAction(Action action) {
actions.remove(action);
actionHandler.removeAction(action);
if (action.getOwner() != null && action.getOwner() instanceof WebButton) {
Button button = ((WebButton) action.getOwner()).getComponent();
component.removeButton(button);
if (action != null) {
actions.remove(action);
actionHandler.removeAction(action);
if (action.getOwner() != null && action.getOwner() instanceof WebButton) {
Button button = ((WebButton) action.getOwner()).getComponent();
component.removeButton(button);
}
}
}