Skip to content

Commit

Permalink
fix | fixed handling of null values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pohatu committed Mar 14, 2024
1 parent 73b7195 commit 1e69579
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions TsGui/View/GuiOptions/TsFreeText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,19 @@ public void OnValidationChange()

public override async Task UpdateValueAsync(Message message)
{
string s = (await this._querylist.GetResultWrangler(message))?.GetString();
if (s != null)
var wrang = await this._querylist.GetResultWrangler(message);

if (wrang != null)
{
string s = wrang.GetString();

//if required, remove invalid characters and truncate
string invalchars = this.ValidationHandler.GetAllInvalidCharacters();
if (!string.IsNullOrEmpty(invalchars)) { s = ResultValidator.RemoveInvalid(s, this.ValidationHandler.GetAllInvalidCharacters()); }
if (this.MaxLength > 0) { s = ResultValidator.Truncate(s, this.MaxLength); }

if (this.ControlText != s) { this.SetValue(s, message); }
}
if (this.ControlText != s) { this.SetValue(s, message); }
LinkingHub.Instance.SendUpdateMessage(this, message);
}

Expand Down

0 comments on commit 1e69579

Please sign in to comment.