diff --git a/product/ERP5Type/mixin/component.py b/product/ERP5Type/mixin/component.py
index 821e092c48362e987586eb92c8c7a7904cc55357..7b55eee7fd7625233cc94d62cf55ce6be5a51934 100644
--- a/product/ERP5Type/mixin/component.py
+++ b/product/ERP5Type/mixin/component.py
@@ -251,11 +251,8 @@ class ComponentMixin(PropertyRecordableMixin, Base):
     Check whether there are error messages, useful to display errors in the UI
     without calling getErrorMessageList() which translates error messages
     """
-    try:
-      self.workflow_history['component_validation_workflow'][-1]['error_message']
-      return True
-    except KeyError:
-      return False
+    workflow = self.workflow_history['component_validation_workflow'][-1]
+    return bool(workflow['error_message'])
 
   security.declareProtected(Permissions.AccessContentsInformation,
                             'getErrorMessageList')