Possible encrypt fix

This commit is contained in:
2015-10-21 09:33:13 +02:00
parent ac0057a079
commit 96deb8b9bb
+13 -10
View File
@@ -57,24 +57,27 @@ namespace ErgometerLibrary
string str;
NetCommand net;
try {
str = AESEncrypt.DecryptString(ReadString(client));
}
catch (Exception e)
{
str = "";
net = new NetCommand(NetCommand.CommandType.ERROR, 0);
}
str = ReadString(client);
if (str != "")
{
try
{
str = AESEncrypt.DecryptString(str);
}
catch (Exception e)
{
str = "";
net = new NetCommand(NetCommand.CommandType.ERROR, 0);
}
try {
net = NetCommand.Parse(str);
}
catch(Exception e)
catch (Exception e)
{
net = new NetCommand(NetCommand.CommandType.ERROR, 0);
}
}
else
net = new NetCommand(NetCommand.CommandType.ERROR, 0);
return net;