Fix a crash in the painting assistants with certain files.
Done by double checking if an assistant pointer exists before using it.