[TIMOB-18262] Short circuit path checks on valid path
[TIMOB-18262] Refactor & safety checks
Merge pull request #6520 from vishalduggal/timob-18262

[TIMOB-18262] Short circuit path checks on valid path