During the validation process, the following questions arose.
Get one name with data.getName().
And there is a procedure to verify that the value of this name is correct.
It's very simple.
But what if "data" itself is "null"?
It will try null.getName(), which will eventually result in NEC.
A question arose here.
First of all, NEC is wrong. = Not intentional.
However, when data is null, it can be interpreted that the value of name is incorrect (when it should not be null). = Serves purpose.
In other words, the fact that the logic is no longer executed in the section I want is the same.
However, an unintended NEC occurred, and I wonder if it can be interpreted as achieving my purpose.
How is it?
Is it correct to put additional logic to verify the data itself?