Bug in Player.SetCustomProperties, expectedValues is not being null checked before being used
public void SetCustomProperties(Hashtable propertiesToSet, Hashtable expectedValues = null, WebFlags webFlags = null) { if (propertiesToSet == null) { return; } Hashtable customProps = propertiesToSet.StripToStringKeys() as Hashtable; Hashtable customPropsToCheck = expectedValues.StripToStringKeys() as Hashtable;
0
Comments
-
Thanks for the report.
0 -
Hi @KirkGames,
Thank you for choosing Photon and for your report!
I guess you are referring to this exact line:Hashtable customPropsToCheck = expectedValues.StripToStringKeys() as Hashtable;
This line won't throw a NullReferenceException since the extension method StripToStringKeys includes the null check itself.public static Hashtable StripToStringKeys(this IDictionary original) { Hashtable target = new Hashtable(); if (original != null) { foreach (object key in original.Keys) { if (key is string) { target[key] = original[key]; } } } return target; }
0 -
his eyes open0