Fixed password storage when it isn't set

Disabled hashing on an empty string
This commit is contained in:
juanjp600
2016-08-29 17:42:37 -03:00
parent ca5ad3ece4
commit b3f0f71d43
+5 -1
View File
@@ -56,7 +56,11 @@ namespace Barotrauma.Networking
name = name.Replace(";", ""); name = name.Replace(";", "");
this.name = name; this.name = name;
this.password = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(password))); this.password = "";
if (password.Length>0)
{
this.password = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(password)));
}
config = new NetPeerConfiguration("barotrauma"); config = new NetPeerConfiguration("barotrauma");