From d12f6bda51d0bc60463412ff8cac755ef08d2c92 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Sat, 3 Nov 2018 22:02:39 +0530 Subject: [PATCH 1/7] fixes issue #683 --- .../openevent/general/auth/EditProfileFragment.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index 43cc7bf823..a72add1a0b 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -58,11 +58,14 @@ class EditProfileFragment : Fragment() { context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) drawable?.let { icon -> - Picasso.get() - .load(imageUrl) - .placeholder(icon) - .transform(CircleTransform()) - .into(rootView.profilePhoto) + if(!imageUrl.equals("")) { // picasso requires the imageUrl to be non empty + Picasso.get() + .load(imageUrl) + .placeholder(icon) + .transform(CircleTransform()) + .into(rootView.profilePhoto) + + } } } } From 158125a6a958e7cdf05a31cce051adef9feec143 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Sat, 3 Nov 2018 23:36:26 +0530 Subject: [PATCH 2/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../org/fossasia/openevent/general/auth/EditProfileFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index a72add1a0b..6c847cb632 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -58,7 +58,7 @@ class EditProfileFragment : Fragment() { context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) drawable?.let { icon -> - if(!imageUrl.equals("")) { // picasso requires the imageUrl to be non empty + if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty Picasso.get() .load(imageUrl) .placeholder(icon) From 31c11bae84ad32d01f008a3c17412b4ab50bc2e7 Mon Sep 17 00:00:00 2001 From: Shivansh Beohar <33032175+trancenoid@users.noreply.github.com> Date: Sun, 4 Nov 2018 01:31:14 +0530 Subject: [PATCH 3/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../org/fossasia/openevent/general/auth/EditProfileFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index 6c847cb632..b833a6aa1d 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -55,10 +55,10 @@ class EditProfileFragment : Fragment() { val imageUrl = it.avatarUrl.nullToEmpty() rootView.firstName.setText(userFirstName) rootView.lastName.setText(userLastName) + if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) drawable?.let { icon -> - if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty Picasso.get() .load(imageUrl) .placeholder(icon) From 873ce482c094941e2ef4d85c4920e406aba03625 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Sun, 4 Nov 2018 22:29:37 +0530 Subject: [PATCH 4/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../general/auth/EditProfileFragment.kt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index 6c847cb632..e71baf1bd2 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -55,16 +55,15 @@ class EditProfileFragment : Fragment() { val imageUrl = it.avatarUrl.nullToEmpty() rootView.firstName.setText(userFirstName) rootView.lastName.setText(userLastName) - context?.let { ctx -> - val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) - drawable?.let { icon -> - if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty + if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty + context?.let { ctx -> + val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) + drawable?.let { icon -> Picasso.get() - .load(imageUrl) - .placeholder(icon) - .transform(CircleTransform()) - .into(rootView.profilePhoto) - + .load(imageUrl) + .placeholder(icon) + .transform(CircleTransform()) + .into(rootView.profilePhoto) } } } From 184741a7a1f626265f28ebb389b323c6834d78a9 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Sun, 4 Nov 2018 23:34:05 +0530 Subject: [PATCH 5/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../fossasia/openevent/general/auth/EditProfileFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index e71baf1bd2..3f2796fee0 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -55,10 +55,10 @@ class EditProfileFragment : Fragment() { val imageUrl = it.avatarUrl.nullToEmpty() rootView.firstName.setText(userFirstName) rootView.lastName.setText(userLastName) - if(!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty + if(!imageUrl.isEmpty()){ // picasso requires the imageUrl to be non empty context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) - drawable?.let { icon -> + drawable?.let{ icon -> Picasso.get() .load(imageUrl) .placeholder(icon) From 975b03aea93b582391bb9dd73c9205d5107d9840 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Mon, 5 Nov 2018 00:13:34 +0530 Subject: [PATCH 6/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../org/fossasia/openevent/general/auth/EditProfileFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index 3f2796fee0..d42cb656e6 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -55,7 +55,7 @@ class EditProfileFragment : Fragment() { val imageUrl = it.avatarUrl.nullToEmpty() rootView.firstName.setText(userFirstName) rootView.lastName.setText(userLastName) - if(!imageUrl.isEmpty()){ // picasso requires the imageUrl to be non empty + if (!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) drawable?.let{ icon -> From 314eea9598d3ffb66031eb7328862cd3b104c3a1 Mon Sep 17 00:00:00 2001 From: alphaStrangler Date: Mon, 5 Nov 2018 00:28:34 +0530 Subject: [PATCH 7/7] Fix : issue #683 : Crash on editing profile with no profile picture This fix addresses the problem which crashed the app when a user with no profile picture tries to edit the profile. The imageUrl must not be an empty string, as required by Picasso.get() method --- .../org/fossasia/openevent/general/auth/EditProfileFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt index d42cb656e6..c05082af0f 100644 --- a/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt +++ b/app/src/main/java/org/fossasia/openevent/general/auth/EditProfileFragment.kt @@ -58,7 +58,7 @@ class EditProfileFragment : Fragment() { if (!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty context?.let { ctx -> val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp) - drawable?.let{ icon -> + drawable?.let { icon -> Picasso.get() .load(imageUrl) .placeholder(icon)