From 7265621a3ccf6a45e25d67804dfce0f075a6cdb0 Mon Sep 17 00:00:00 2001 From: Pepper Date: Mon, 5 Oct 2015 16:38:23 -0400 Subject: fixed bug in color.py --- lib/param/color.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/param') diff --git a/lib/param/color.py b/lib/param/color.py index 096a1e8..02d694d 100644 --- a/lib/param/color.py +++ b/lib/param/color.py @@ -9,11 +9,12 @@ class Color(Param): """ def __init__(self, value, classname=""): super(Color, self).__init__(classname=classname) - try: - self.value = self._color_sanitize(value) - except Exception as e: - self.err_warn("Unable to sanitize the color: %s" % str(value)) - self.err_warn(str(e)) + if value: + try: + self.value = self._color_sanitize(value) + except Exception as e: + self.err_warn("Unable to sanitize the color: %s" % str(value)) + self.err_warn(str(e)) def _color_sanitize(self, s): if s == "": return "transparent" -- cgit v1.2.3-70-g09d2