Error to read .HistoricItem.getState() on null

I’m sorry, I just didn’t get it right away.
Syntax:

if (Total_act.historicState(parse(Total_String)) != null) {
    Cht_at7 = Total_act.historicState(parse(Total_String)).state as Number
}

it works! Thanks!