small refactoring to avoid null pointer when opening non-spoofax files with spoofax editor