diff --git a/lib/core/agent.py b/lib/core/agent.py index aa308914b..f200d8f75 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -241,7 +241,8 @@ class Agent(object): if not (expression and expression[0] == ';') and not (query and query[-1] in ('(', ')') and expression and expression[0] in ('(', ')')) and not (query and query[-1] == '('): query += " " - query = "%s%s" % (query.replace('\\', BOUNDARY_BACKSLASH_MARKER), expression) + if query: + query = "%s%s" % (query.replace('\\', BOUNDARY_BACKSLASH_MARKER), expression) return query