is `x` a variable in the same encapsulation or is ...
# announcements
b
is
x
a variable in the same encapsulation or is it a class variable? If
x
has the possibility to change between the
x != null
and
x.isEmpty()
check then you can get the NPE. You should be able to do
x.orEmpty().isEmpty()
instead