[TIMOB-12919] Avoid class cast exception
Merge pull request #3987 from vishalduggal/timob-12919

[TIMOB-12919] Avoid class cast exception