From 6aa241b2681f1c358d039b1199996154d6574c9c Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Tue, 17 Apr 2012 12:07:32 +0200 Subject: [PATCH] fixed error in get_active_slide() --- openslides/projector/api.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openslides/projector/api.py b/openslides/projector/api.py index 2f3ed887c..f07d60a49 100644 --- a/openslides/projector/api.py +++ b/openslides/projector/api.py @@ -4,7 +4,10 @@ from django.template.loader import render_to_string def split_sid(sid): - data = sid.split('-') + try: + data = sid.split('-') + except AttributeError: + return None if len(data) == 2: model = data[0] id = data[1] @@ -18,7 +21,11 @@ def split_sid(sid): def get_slide_from_sid(sid): - key, id = split_sid(sid) + try: + key, id = split_sid(sid) + except TypeError: + return None + if id is not None: return SLIDE[key].model.objects.get(pk=id).slide() try: