diff --git a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/ProfileFragment.java b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/ProfileFragment.java index 37ca392..1dedff4 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/ProfileFragment.java +++ b/app/MyHyvesBookPlusStagram/app/src/main/java/nl/myhyvesbookplus/tagram/ProfileFragment.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.app.Fragment; +import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -79,10 +80,10 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{ } FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); - if (user != null) { - httpsReference = FirebaseStorage.getInstance().getReferenceFromUrl(user.getPhotoUrl().toString()); - } - } + if (user != null && user.getPhotoUrl() != null) { + httpsReference = FirebaseStorage.getInstance().getReferenceFromUrl(user.getPhotoUrl().toString()); + } + } /** * Assigns all views. diff --git a/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_profile.xml b/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_profile.xml index aae3ae2..9001658 100644 --- a/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_profile.xml +++ b/app/MyHyvesBookPlusStagram/app/src/main/res/layout/fragment_profile.xml @@ -15,7 +15,7 @@ android:orientation="vertical">