Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
budgetpreneur committed Sep 19, 2023
1 parent 6137a6c commit f5587d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Api/PubnubApi/Security/Crypto/CryptoModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public string Decrypt(string data)
}
if (_cryptor is LegacyCryptor)
{
return _cryptor?.Decrypt(data);
return _cryptor.Decrypt(data);
}
CryptorHeader header = CryptorHeader.FromBytes(Convert.FromBase64String(data));
if (header == null)
Expand All @@ -64,7 +64,7 @@ public string Decrypt(string data)
{
throw new PNException("unknown cryptor error");
}
return _fallbackCryptor?.Decrypt(data);
return _fallbackCryptor.Decrypt(data);
}
if (!header.Identifier.SequenceEqual(_cryptor?.Identifier))
{
Expand All @@ -80,7 +80,7 @@ public byte[] Decrypt(byte[] data)
}
if (_cryptor is LegacyCryptor)
{
return _cryptor?.Decrypt(data);
return _cryptor.Decrypt(data);
}
CryptorHeader header = CryptorHeader.FromBytes(data);
if (header == null)
Expand All @@ -89,7 +89,7 @@ public byte[] Decrypt(byte[] data)
{
throw new PNException("unknown cryptor error");
}
return _fallbackCryptor?.Decrypt(data);
return _fallbackCryptor.Decrypt(data);
}
if (!header.Identifier.SequenceEqual(_cryptor?.Identifier))
{
Expand All @@ -109,7 +109,7 @@ public void DecryptFile(string sourceFile, string destinationFile)
}
if (_cryptor is LegacyCryptor)
{
_cryptor?.DecryptFile(sourceFile, destinationFile);
_cryptor.DecryptFile(sourceFile, destinationFile);
return;
}
CryptorHeader header = CryptorHeader.FromFile(sourceFile);
Expand All @@ -119,7 +119,7 @@ public void DecryptFile(string sourceFile, string destinationFile)
{
throw new PNException("unknown cryptor error");
}
_fallbackCryptor?.DecryptFile(sourceFile, destinationFile);
_fallbackCryptor.DecryptFile(sourceFile, destinationFile);
return;
}
if (!header.Identifier.SequenceEqual(_cryptor?.Identifier))
Expand Down

0 comments on commit f5587d7

Please sign in to comment.