Skip to content

Commit

Permalink
fix: add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
InuInu2022 committed Dec 6, 2023
1 parent f88ee93 commit 92fda28
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LibSasara.VoiSona/Model/Talk/TstPrjEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public static class TstPrjExtension
public static Memory<byte> Copy(
this TstPrj source
){
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}

var len = source.Data.Length;
var replaced = new Memory<byte>(new byte[len]);
source.Data.CopyTo(replaced);
Expand All @@ -40,6 +45,11 @@ public static Memory<byte> ReplaceVoice(
int trackIndex = 0
)
{
if (newVoice is null)
{
throw new ArgumentNullException(nameof(newVoice));
}

var copied = source.Copy();

TryFindTrack(
Expand Down

0 comments on commit 92fda28

Please sign in to comment.