diff --git a/src/wp-admin/js/widgets/custom-html-widgets.js b/src/wp-admin/js/widgets/custom-html-widgets.js
index 6d5b1679c8..5469755870 100644
--- a/src/wp-admin/js/widgets/custom-html-widgets.js
+++ b/src/wp-admin/js/widgets/custom-html-widgets.js
@@ -215,7 +215,7 @@ wp.customHtmlWidgets = ( function( $ ) {
* @returns {void}
*/
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
- control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length );
+ control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
control.updateErrorNotice( errorAnnotations );
}
});