[T5388][FIX] check if key is in dictionary before accesing it

Merged Javier Vescio requested to merge T5388 into 17.0

Merge request reports