Skip to content

Commit

Permalink
No nullhandling of record control
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Sep 19, 2022
1 parent 3f38a11 commit 1fc1a65
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions XRMTokensRun/XRMTR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ private void Enable(bool on)
{
cmbTable.Enabled = on && Service != null;
btnGetRecord.Enabled = on && cmbTable.SelectedEntity is EntityMetadata;
btnRefresh.Enabled = on && record?.Record != null;
btnOpenRecord.Enabled = on && record?.Record != null;
gbTokens.Enabled = on && record?.Record != null;
btnAddToken.Enabled = on && record?.Record != null && cmbTokenHelp.SelectedItem is TokenHelp;
btnSmartColumn.Enabled = on && record?.Record != null;
btnSmartExpand.Enabled = on && record?.Record != null;
btnSmartIf.Enabled = on && record?.Record != null;
btnSmartSystem.Enabled = on && record?.Record != null;
btnSmartRandom.Enabled = on && record?.Record != null;
btnRefresh.Enabled = on && record.Record != null;
btnOpenRecord.Enabled = on && record.Record != null;
gbTokens.Enabled = on && record.Record != null;
btnAddToken.Enabled = on && record.Record != null && cmbTokenHelp.SelectedItem is TokenHelp;
btnSmartColumn.Enabled = on && record.Record != null;
btnSmartExpand.Enabled = on && record.Record != null;
btnSmartIf.Enabled = on && record.Record != null;
btnSmartSystem.Enabled = on && record.Record != null;
btnSmartRandom.Enabled = on && record.Record != null;
btnBackTool.Enabled = btnBackTool.Tag != null;
}

Expand Down Expand Up @@ -511,7 +511,7 @@ private void btnOpen_Click(object sender, EventArgs e)

private void btnOpenRecord_Click(object sender, EventArgs e)
{
if (Service.GetEntityFormUrl(record?.Record?.ToEntityReference()) is string url && !string.IsNullOrEmpty(url))
if (Service.GetEntityFormUrl(record.Record?.ToEntityReference()) is string url && !string.IsNullOrEmpty(url))
{
ConnectionDetail.OpenUrlWithBrowserProfile(new Uri(url));
}
Expand Down

0 comments on commit 1fc1a65

Please sign in to comment.