i have an activity which initialize a variable of my Application class (AppVariables):
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
app = (AppVariables) getApplicationContext();
}
when using this if condition which check if a drawable is null or not i get a null pointer exception from some reason:
if (app.getFacebookCurrentUser().getProfilePicture() != null)
can’t really under stand why.. i am checking if it null..
Sorry guys, it was silly question but at least lets learn from it..
i should have check that app.getFacebookCurrentUser() isn’t null.
the right condition is:
if (app.getFacebookCurrentUser() != null && app.getFacebookCurrentUser().getProfilePicture() != null)