Dialog: Check for empty array in addition to empty object when checking if there are buttons. Fixes #9043 - Dialog: Buttonpane shown with no buttons when modifying native prototypes.