Bug fix - NPE in PHPStorm when content of "path" tag points to unexisting file

It's worth to review rest code because there some more places were input data are not validated and more NPEs are possible.