ApiSandbox: Fix upload widget
[lhc/web/wiklou.git] / resources / src / mediawiki.special.apisandbox / apisandbox.js
index 395fb8b..c2c5960 100644 (file)
                                // Can't, sorry.
                        },
                        apiCheckValid: function () {
-                               var ok = this.getValue() !== null || suppressErrors;
-                               this.setIcon( ok ? null : 'alert' );
+                               var ok = this.getValue() !== null && this.getValue() !== undefined || suppressErrors;
+                               this.info.setIcon( ok ? null : 'alert' );
                                this.setTitle( ok ? '' : mw.message( 'apisandbox-alert-field' ).plain() );
                                return $.Deferred().resolve( ok ).promise();
                        }