```
List <State> states = JsonConvert.DeserializeObject <List<State>> (json);

State state;
foreach(State i in states) {
if (i.StateID == Convert.ToInt32(extendedProperties["WFState"])) {
    state = i;
    } 
else {}
}

try {
    btnApprove.Visible = state.Actions.Approved.NextStateID != null ? true : false;
    btnApprove.Text = state.Actions.Approved.Title.ToString();
}
catch (Exception ex) {
    btnApprove.Visible = false;
}

```

`"state"` in `"state.Actions.Approved.NextStateID != null ? true : false;"` is giving the "use of unassigned local variable" even though it assigned.