don't crash if we're passed a null value
This commit is contained in:
parent
b7e6cf895e
commit
714ea0aa58
@ -147,6 +147,9 @@ namespace UniversalEditor.IO
|
||||
}
|
||||
public void WriteFixedLengthString(string value, Encoding encoding)
|
||||
{
|
||||
if (value == null)
|
||||
return;
|
||||
|
||||
byte[] data = encoding.GetBytes(value);
|
||||
WriteBytes(data);
|
||||
}
|
||||
@ -175,6 +178,9 @@ namespace UniversalEditor.IO
|
||||
[CLSCompliant(false)]
|
||||
public void WriteFixedLengthString(string value, Encoding encoding, uint length, char paddingChar)
|
||||
{
|
||||
if (value == null)
|
||||
return;
|
||||
|
||||
string v = value;
|
||||
if (v == null) v = String.Empty;
|
||||
byte[] data = encoding.GetBytes(v);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user