Fixed crash on invalid code #6080