Skip to content

Commit

Permalink
fix: null check
Browse files Browse the repository at this point in the history
  • Loading branch information
InuInu2022 committed Dec 6, 2023
1 parent 92fda28 commit 2811209
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LibSasara.VoiSona/Model/Talk/Utterance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ public XElement Tsml {
return xml;
}
set {
var hasRoot = value
.Element("tsml") is not null;
var hasRoot = value?
.Element("tsml") is not null;
var content = hasRoot
? value.Element("tsml").Elements()
: value.Elements("acoustic_phrase");
? value!.Element("tsml").Elements()
: value!.Elements("acoustic_phrase");
var sb = new StringBuilder(1000);
foreach(var i in content)
{
Expand Down

0 comments on commit 2811209

Please sign in to comment.