I'm having problems with a NullPointerException.
I was doing the debugging and the element is not null, I have the problem in the first IF and I can not see what the problem is. I thought that happened when the state of the element was null, but I tried to fix it and it did not work
// Update: The problem is when I Check the status
for (Items item : master.getItems()) {
try {
if (item.getCompany_status().equals("active") || item.getCompany_status().equals("open")) {
if (item.getAddress_snippet() == null) {
cont2++;
Company c = new Company(item.getTitle(), "");
arrayCompany.add(c);
}else {
cont2++;
Company c = new Company(item.getTitle(), item.getAddress_snippet());
arrayCompany.add(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}