filterType = 0;
if((Name != " " && !Name .isEmpty() ) |( userName != " " && !userName.isEmpty() ) | userLock == true | (HQ != " " && !HQ.isEmpty() ) | Area != 0.0 | Route != 0.0 | ( Label != " " && !Label.isEmpty() )){
filterType = filterType + 1;
}
if( (Phone != " " && !Phone.isEmpty() ) | (URL != " " && !URL.isEmpty()) |( City != " " && !City.isEmpty() ) | (Date != " " && !Date.isEmpty())| (Email != " " && !Email.isEmpty()) ){
filterType = filterType + 2;
}
If any of above string contains value then filter type should be added but java throws null pointer exception. How can I fix it?