Getting UI Error saying cannot index property of type text into null value if type list

Certified Senior Developer

When user is taking Yes button action to send mail UI error is popping up saying like below

Expression evaluation error [evaluation ID = 633fa:e25d4] in rule 'em_sendemailconfscreen' (called by rules 'em_receiptregisterform' > 'em_receiptcheck') : An error occurred while executing a save: Expression evaluation error in rule 'em_getemaildata' (called by rule 'm_getsystemstatusincorrectemailbody') at function a!forEach [line 78]: Invalid index: Cannot index property 'payment_no' of type Text into null value of type MV_CHECK_EISM_CASHDATA?list

The block of code where the error pointing out is below: Could you please suggest on this

a!localvariables{

local!isthree:contains(
touniformstring(index(ri!eemDetails, "isthree", {})),
cons!EM_EVENT_STATUS[1]
),
local!prNo: index(
index(
ri!eemDetails,
"pr_no",
""
),
1,
""
),

local!untickedIds: if(
local!isthree,
a!forEach(
items: ri!unselectedGridRows.payment_no,
expression: if(
rule!APN_isBlank(tostring(fv!item)),
local!prNo,
tostring(fv!item)
)
),
{}
),

}

  Discussion posts and replies are publicly visible