diff --git a/frappe/__init__.py b/frappe/__init__.py
index 3aa25b1e7e..e8fbba56c9 100644
--- a/frappe/__init__.py
+++ b/frappe/__init__.py
@@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template
-__version__ = "7.0.40"
+__version__ = "7.0.41"
local = Local()
diff --git a/frappe/model/document.py b/frappe/model/document.py
index c4049b8524..ea1489b6c8 100644
--- a/frappe/model/document.py
+++ b/frappe/model/document.py
@@ -999,8 +999,12 @@ def execute_action(doctype, name, action, **kwargs):
getattr(doc, action)(**kwargs)
except frappe.ValidationError:
# add a comment (?)
- doc.add_comment('Comment',
- _('Action Failed') + '
' + json.loads(frappe.local.message_log[-1]).get('message'))
+ if frappe.local.message_log:
+ msg = json.loads(frappe.local.message_log[-1]).get('message')
+ else:
+ msg = '
' + frappe.get_traceback() + '
'
+
+ doc.add_comment('Comment', _('Action Failed') + '