Skip to content

NullPointerException on .value() #41

@AndreySoloviov

Description

@AndreySoloviov

In FormValidator.class on evaluateCondition method:
final Object value = adapter.getFieldValue(null, conditionView)

public class CompoundAdapter implements IFieldAdapter<CompoundButton, Boolean> {

    @Override
    public Boolean getFieldValue(Annotation annotation, CompoundButton fieldView) {
        return ((Checked) annotation).value() == fieldView.isChecked();
    }
}

Should be like:

public class CompoundAdapter implements IFieldAdapter<CheckBox, Boolean>
{
    @Override
    public Boolean getFieldValue(Annotation annotation, CheckBox fieldView)
    {
        return (annotation == null || ((Checked) annotation).value())  == fieldView.isChecked();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions