From 6db7ca20aecf4525e6776354dfae7a4cbd7c730f Mon Sep 17 00:00:00 2001
From: Paul Lagerweij
Date: Wed, 21 Jun 2017 13:07:29 +0200
Subject: [PATCH] default picture if no profile photo in firebase
---
.../nl/myhyvesbookplus/tagram/ProfileFragment.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
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 1dedff4..6341dd6 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
@@ -13,7 +13,6 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ImageView;
-
import com.bumptech.glide.Glide;
import com.firebase.ui.storage.images.FirebaseImageLoader;
import com.google.firebase.auth.FirebaseAuth;
@@ -22,8 +21,6 @@ import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.auth.FirebaseAuth;
-
-
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
@@ -104,13 +101,17 @@ public class ProfileFragment extends Fragment implements View.OnClickListener{
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_profile, container, false);
findViews(view);
- Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture);
+
+ if (httpsReference != null) {
+ Glide.with(this).using(new FirebaseImageLoader()).load(httpsReference).into(profilePicture);
+ }
+
return view;
}
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
- if (mListener != null) {
+ - if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}