mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 20:03:41 +01:00
fix: return empty SeString if ptr == null
This commit is contained in:
parent
fc9ef07005
commit
49345847a5
1 changed files with 8 additions and 0 deletions
|
|
@ -61,6 +61,11 @@ namespace Dalamud.Game.Text.SeStringHandling
|
|||
UIForegroundPayload.UIForegroundOff,
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Gets an empty SeString.
|
||||
/// </summary>
|
||||
public static SeString Empty => new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ordered list of payloads included in this SeString.
|
||||
/// </summary>
|
||||
|
|
@ -105,6 +110,9 @@ namespace Dalamud.Game.Text.SeStringHandling
|
|||
/// <returns>An SeString containing parsed Payload objects for each payload in the data.</returns>
|
||||
public static unsafe SeString Parse(byte* ptr, int len)
|
||||
{
|
||||
if (ptr == null)
|
||||
return Empty;
|
||||
|
||||
var payloads = new List<Payload>();
|
||||
|
||||
using (var stream = new UnmanagedMemoryStream(ptr, len))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue