From b212321c07e6fe02da720cf1b8034990d76f495c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 26 Jun 2015 10:30:53 +0200 Subject: [PATCH] Fixes #1278 --- lib/core/agent.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 317d5c656..cf1005c3c 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -245,8 +245,7 @@ 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 += " " - if query: - query = "%s%s" % (query.replace('\\', BOUNDARY_BACKSLASH_MARKER), expression) + query = "%s%s" % ((query or "").replace('\\', BOUNDARY_BACKSLASH_MARKER), expression) return query