Error message when editing posts

It could be that my recent fixes introduced this problem. I’m investigating this.