Skip to content
Snippets Groups Projects
Commit 32c4fcb0 authored by Greyson Parrelli's avatar Greyson Parrelli Committed by Alex Hart
Browse files

Improve handling of empty profiles.

parent e2703b45
Branches release-0.13
No related tags found
No related merge requests found
...@@ -451,6 +451,11 @@ public class RetrieveProfileJob extends BaseJob { ...@@ -451,6 +451,11 @@ public class RetrieveProfileJob extends BaseJob {
String plaintextProfileName = Util.emptyIfNull(ProfileUtil.decryptString(profileKey, profileName)); String plaintextProfileName = Util.emptyIfNull(ProfileUtil.decryptString(profileKey, profileName));
if (TextUtils.isEmpty(plaintextProfileName)) {
Log.w(TAG, "No name set on the profile for " + recipient.getId() + " -- Leaving it alone");
return;
}
ProfileName remoteProfileName = ProfileName.fromSerialized(plaintextProfileName); ProfileName remoteProfileName = ProfileName.fromSerialized(plaintextProfileName);
ProfileName localProfileName = recipient.getProfileName(); ProfileName localProfileName = recipient.getProfileName();
...@@ -474,10 +479,6 @@ public class RetrieveProfileJob extends BaseJob { ...@@ -474,10 +479,6 @@ public class RetrieveProfileJob extends BaseJob {
recipient.isBlocked(), recipient.isGroup(), recipient.isSelf(), localDisplayName.isEmpty(), !remoteDisplayName.equals(localDisplayName))); recipient.isBlocked(), recipient.isGroup(), recipient.isSelf(), localDisplayName.isEmpty(), !remoteDisplayName.equals(localDisplayName)));
} }
} }
if (TextUtils.isEmpty(plaintextProfileName)) {
Log.i(TAG, "No profile name set for " + recipient.getId());
}
} catch (InvalidCiphertextException e) { } catch (InvalidCiphertextException e) {
Log.w(TAG, "Bad profile key for " + recipient.getId()); Log.w(TAG, "Bad profile key for " + recipient.getId());
} catch (IOException e) { } catch (IOException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment