diff --git a/src/common/defs.py b/src/common/defs.py
index 30b6dda3ced3cf0b9bff95eb630164471f33b220..7172021caf58e7c537d28b58deca92d8f05d6b47 100644
--- a/src/common/defs.py
+++ b/src/common/defs.py
@@ -32,7 +32,8 @@
 try:
     node = subprocess.Popen('hg tip --template "{node|short}"', shell=True,
         stdout=subprocess.PIPE).communicate()[0]
-    version += '-' + node
+    if node:
+        version += '-' + node
 except Exception:
     pass