Skip to content

Commit

Permalink
null checks on dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Mar 20, 2018
1 parent aa38e79 commit c6a40ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
33 changes: 6 additions & 27 deletions src/Android/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Android/Services/DeviceActionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ public void HideLoading()
public Task<string> DisplayPromptAync(string title = null, string description = null, string text = null)
{
var activity = (MainActivity)CurrentContext;
if(activity == null)
{
return Task.FromResult<string>(null);
}

var alertBuilder = new AlertDialog.Builder(activity);
alertBuilder.SetTitle(title);
alertBuilder.SetMessage(description);
Expand Down
2 changes: 1 addition & 1 deletion src/App/Utilities/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public static FormEntryCell MakeUriCell(string value, UriMatchType? match, Table
{
selectedVal = exactingMatchVal;
}
else if(val != AppResources.Default)
else if(val != null && val != AppResources.Default)
{
selectedVal = UriMatchOptionsMap.ElementAt(Array.IndexOf(optionsArr, val) - 1).Key;
}
Expand Down

0 comments on commit c6a40ba

Please sign in to comment.