Your code is processing selected documents. Have you checked all selected documents that they have a ShortName field. It'll only take one document with the field to be missing to display the message.
Also make sure when checking the document properties you're doing it from the view and not with the doc opened. Otheriwse you risk seeing fields which are added only when the document is opened in the UI.
Feedback response number WEBBAVKDZQ created by Alex Elliott on 02/01/2018