diff options
| author | Pepper <pepper@scannerjammer.com> | 2015-10-05 16:38:23 -0400 |
|---|---|---|
| committer | Pepper <pepper@scannerjammer.com> | 2015-10-05 16:38:23 -0400 |
| commit | 7265621a3ccf6a45e25d67804dfce0f075a6cdb0 (patch) | |
| tree | 036653c5195fe18205cb0e23f21f2d5df6f526e8 /lib/param/color.py | |
| parent | 1d438583118aeb523a63c8e7425e480a08148473 (diff) | |
fixed bug in color.py
Diffstat (limited to 'lib/param/color.py')
| -rw-r--r-- | lib/param/color.py | 11 |
1 files changed, 6 insertions, 5 deletions
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" |
