(GetScheme): fixed potential bug when looking up unknown encryption scheme.

This commit is contained in:
morkt 2014-09-09 01:04:27 +04:00
parent 1c5008d799
commit 12df1dcdfd

View File

@ -290,11 +290,9 @@ NextEntry:
public static ICrypt GetScheme (string scheme)
{
ICrypt algorithm = NoCryptAlgorithm;
if (!string.IsNullOrEmpty (scheme))
{
KnownSchemes.TryGetValue (scheme, out algorithm);
}
ICrypt algorithm;
if (string.IsNullOrEmpty (scheme) || !KnownSchemes.TryGetValue (scheme, out algorithm))
algorithm = NoCryptAlgorithm;
return algorithm;
}