B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 #762

Showing only changes of commit 1b1dc78548 - Show all commits
@@ -69,7 +69,9 @@ namespace Volian.Controls.Library
{ {
MyItemInfo = _MyDisplayTabItem.MyItemInfo; MyItemInfo = _MyDisplayTabItem.MyItemInfo;
} }
if (MyItemInfo.IsRNOPart == true) if (MyItemInfo != null)
{
if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button.
{ {
btnApplicabilitychg.Enabled = false; btnApplicabilitychg.Enabled = false;
} }
@@ -80,6 +82,7 @@ namespace Volian.Controls.Library
} }
} }
} }
}
public int ViewMode public int ViewMode
{ {
get get
@@ -402,7 +405,9 @@ namespace Volian.Controls.Library
if (_MyItemInfo != null) if (_MyItemInfo != null)
{ {
if (this.Visible == false) return; if (this.Visible == false) return;
if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. if (MyItemInfo != null)
Outdated
Review

Also, I am not sure how this would ever get hit as isn't this basically the same check as line 405?

Also, I am not sure how this would ever get hit as isn't this basically the same check as line 405?
Outdated
Review

in addition to Matt's comment, the MyItemInfo references should be "_MyItemInfo" as we are in the Set portion of "MyItemInfo". All of the other references in this Set code use "_MyItemInfo".

in addition to Matt's comment, the MyItemInfo references should be "_MyItemInfo" as we are in the Set portion of "MyItemInfo". All of the other references in this Set code use "_MyItemInfo".
Outdated
Review

The default is enabled. If there _MyItemInfo is null, then the users have not entered a step yet.

The default is enabled. If there _MyItemInfo is null, then the users have not entered a step yet.
Outdated
Review

As mentioned above this 2nd if statement that you added is unnecessary - I took a screenshot and attached here to re-illustrate. The part with a purple square is unnecessary because that is already done by the part in the red square.

As mentioned above this 2nd if statement that you added is unnecessary - I took a screenshot and attached here to re-illustrate. The part with a purple square is unnecessary because that is already done by the part in the red square.
{
if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button.
{ {
btnApplicabilitychg.Enabled = false; btnApplicabilitychg.Enabled = false;
} }
@@ -410,6 +415,7 @@ namespace Volian.Controls.Library
{ {
btnApplicabilitychg.Enabled = true; btnApplicabilitychg.Enabled = true;
} }
}
IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig; IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig;
List<int> apples = cfg.MasterSlave_Applicability.GetFlags(); List<int> apples = cfg.MasterSlave_Applicability.GetFlags();
UnwireCheckboxes(true); UnwireCheckboxes(true);