CruxFramework / crux-widgets

6 stars 4 forks source link

MaskedTextBox is throwing an exception when setClearIfNotValid is setted as true #739

Open samuelcardoso opened 8 years ago

samuelcardoso commented 8 years ago

The exception occurs in: org.cruxframework.crux.widgets.client.maskedtextbox.MaskedInput.onBlur(BlurEvent) it's a NPE at textBox field when trying to access it's properties.

samuelcardoso commented 8 years ago

A workaround was to avoid appling the mask again after the setClearIfNotValid is setted. So the following code was removed:

if(this.formatter != null && this.formatter instanceof MaskedFormatter)
{
  MaskedFormatter masked = (MaskedFormatter)formatter;
  masked.applyMask(this, clearIfNotValid);
}