Fixed null pointer in constraints