I have a contributed Action declared as:
public SomeObject AddAllowance(IClaim claim, ICustomer customer)
I have a Disable function which uses some simple logic against the claim object to decide whether the action should be enabled or disabled.
public string DisableAddAllowance(IClaim claim, ICustomer customer)
if (((Claim)claim).CurrentStatus != ClaimStatus.PENDING || ((Claim)claim).CurrentStatus != ClaimStatus.AWARDED)
return "You are not allowed to Add Allowance because the current status of the claim is not PENDING";
My problem is the in the Disable method, the claim is null and the method therefore fails with an null reference exception.
Am I doing something wrong here?