Skip to content

Commit

Permalink
Handle AvatarHash NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Dec 21, 2021
1 parent 7f5ada6 commit 16f0274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2996,7 +2996,7 @@ private void OnPersonaState(SteamFriends.PersonaStateCallback callback) {

string? avatarHash = null;

if ((callback.AvatarHash.Length > 0) && callback.AvatarHash.Any(static singleByte => singleByte != 0)) {
if ((callback.AvatarHash?.Length > 0) && callback.AvatarHash.Any(static singleByte => singleByte != 0)) {
#pragma warning disable CA1308 // False positive, we're intentionally converting this part to lowercase and it's not used for any security decisions based on the result of the normalization
avatarHash = Convert.ToHexString(callback.AvatarHash).ToLowerInvariant();
#pragma warning restore CA1308 // False positive, we're intentionally converting this part to lowercase and it's not used for any security decisions based on the result of the normalization
Expand Down

0 comments on commit 16f0274

Please sign in to comment.