Fixes #3687: Check if the version exists before trying to use it, display an error otherwise

The comparison is more clear without space, as a block of code was indented. 

I'm not sur about the behaviour in case of error, because that means that the matching directive can not be used anymore, not even to just change the technique version it is applied to. 

Perhaps we should have a "degraded directive edition screen", where only the Technique version can be change into a valid one ? Note that building that screen is far more involving than the proposed correction.