[Ide] Fix crash when applying policies

Fixes bug #21259 - XS throws exception on Apply polices with invalid file