Fix crash on save of configuration when output file is invalid.
Merge pull request #5247 from alja/saveConf-crashSLHC

SLHC Fix crash on save of configuration when output file is invalid.