Browse Source

Another bugfix on get_from_uid LeObject method

When not found return None and do not try to run len() on None
Yann Weber 8 years ago
parent
commit
949320298d
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      lodel/leapi/leobject.py

+ 2
- 0
lodel/leapi/leobject.py View File

624
         if len(res) > 1:
624
         if len(res) > 1:
625
             raise LodelFatalError("Get from uid returned more than one \
625
             raise LodelFatalError("Get from uid returned more than one \
626
 object ! For class %s with uid value = %s" % (cls, uid))
626
 object ! For class %s with uid value = %s" % (cls, uid))
627
+        elif len(res) == 0:
628
+            return None
627
         return res[0]
629
         return res[0]
628
 
630
 
629
         
631
         

Loading…
Cancel
Save