diff options
author | Dan Williams <dcbw@redhat.com> | 2006-06-15 21:40:33 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2006-06-15 21:40:33 (GMT) |
commit | 31e9671190d46ab99aabf0c01bff2bedb504d790 (patch) | |
tree | 140a644ac76a23d189847bc30dc5f78f198916b3 /sugar/presence/Service.py | |
parent | e1070a21cb703ff32758188c23609cdda4b34861 (diff) |
Validate options for compose_service_type
Diffstat (limited to 'sugar/presence/Service.py')
-rw-r--r-- | sugar/presence/Service.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py index 4e1d72f..9219b80 100644 --- a/sugar/presence/Service.py +++ b/sugar/presence/Service.py @@ -42,6 +42,10 @@ def _txt_to_dict(txt): return prop_dict def compose_service_type(stype, activity_uid): + if not activity_uid: + return stype + if not stype or (type(stype) != type("") and type(stype) != type(u"")): + raise ValueError("stype must be a valid string.") return "_%s_%s" % (activity_uid, stype) def _decompose_service_type(stype): |