Correct condition for Text object

Variable s could be an isntance of Text object so hasClassName is not applicable and javascript fails with message "TypeError: $(...).hasClassName is not a function". Due this fail a job configuration can not be saved (I catched it for Plot plugin)