From 3f780c2dd17fa3daf877dddc818f5f7e7d70f80f Mon Sep 17 00:00:00 2001 From: rembo10 Date: Thu, 1 Nov 2012 18:27:41 -0400 Subject: [PATCH] Don't replace text for Nonetype in helpers.replace_all --- headphones/helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/headphones/helpers.py b/headphones/helpers.py index e68abdd6..298062ee 100644 --- a/headphones/helpers.py +++ b/headphones/helpers.py @@ -144,6 +144,10 @@ def mb_to_bytes(mb_str): return int(float(result.group(1))*1048576) def replace_all(text, dic): + + if not text: + return '' + for i, j in dic.iteritems(): text = text.replace(i, j) return text