summaryrefslogtreecommitdiffstats
path: root/xddlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'xddlib.py')
-rw-r--r--xddlib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/xddlib.py b/xddlib.py
index 6c90e73..3269ef9 100644
--- a/xddlib.py
+++ b/xddlib.py
@@ -163,7 +163,10 @@ def _set_string_length(obj):
elif obj.datatype.type_ == 'unicode':
basesize = 16
default = obj.default
- length = len(default) + 1
+ try:
+ length = len(default) + 1
+ except TypeError:
+ length = 1
size = basesize * length
obj.datatype.length = length
obj.datatype.size = size