mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-01-11 19:44:44 +00:00
Merge pull request #64 from PepperDash/feature/add-xsig-classes
Fix null ref exception for XSigSerialToken
This commit is contained in:
@@ -29,7 +29,8 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
|
||||
public override byte[] GetBytes()
|
||||
{
|
||||
var serialBytes = Encoding.GetEncoding(28591).GetBytes(Value);
|
||||
var serialBytes = String.IsNullOrEmpty(Value) ? new byte[0] : Encoding.GetEncoding(28591).GetBytes(Value);
|
||||
|
||||
var xsig = new byte[serialBytes.Length + 3];
|
||||
xsig[0] = (byte)(0xC8 | (Index >> 7));
|
||||
xsig[1] = (byte)((Index - 1) & 0x7F);
|
||||
|
||||
Reference in New Issue
Block a user