Skip to content

Commit

Permalink
fix NRE when showing the Prompt win non-async call
Browse files Browse the repository at this point in the history
  • Loading branch information
tbambuch committed Oct 7, 2024
1 parent a72bac7 commit 8d207e7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public class PromptBuilder : IAlertDialogBuilder<PromptConfig>
.SetTitle(config.Title)
//.SetView(txt)
.SetPositiveButton(config.OkText, (s, a) =>
config.OnAction(new PromptResult(true, txt.Text)) // DO NOT TRIM RESULT
config.OnAction?.Invoke(new PromptResult(true, txt.Text)) // DO NOT TRIM RESULT
);

if (config.IsCancellable)
{
builder.SetNegativeButton(config.CancelText, (s, a) =>
config.OnAction(new PromptResult(false, txt.Text)) // DO NOT TRIM RESULT
config.OnAction?.Invoke(new PromptResult(false, txt.Text)) // DO NOT TRIM RESULT
);
}
var dialog = builder.Create();
Expand Down Expand Up @@ -118,13 +118,13 @@ public Dialog Build(AppCompatActivity activity, PromptConfig config)
.SetTitle(config.Title)
//.SetView(txt)
.SetPositiveButton(config.OkText, (s, a) =>
config.OnAction(new PromptResult(true, txt.Text)) // DO NOT TRIM RESULT
config.OnAction?.Invoke(new PromptResult(true, txt.Text)) // DO NOT TRIM RESULT
);

if (config.IsCancellable)
{
builder.SetNegativeButton(config.CancelText, (s, a) =>
config.OnAction(new PromptResult(false, txt.Text)) // DO NOT TRIM RESULT
config.OnAction?.Invoke(new PromptResult(false, txt.Text)) // DO NOT TRIM RESULT
);
}
var dialog = builder.Create();
Expand Down

0 comments on commit 8d207e7

Please sign in to comment.