Przeglądaj źródła

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 lat temu
rodzic
commit
949320298d
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2
    0
      lodel/leapi/leobject.py

+ 2
- 0
lodel/leapi/leobject.py Wyświetl plik

@@ -624,6 +624,8 @@ construction and consitency when datas are not complete\n")
624 624
         if len(res) > 1:
625 625
             raise LodelFatalError("Get from uid returned more than one \
626 626
 object ! For class %s with uid value = %s" % (cls, uid))
627
+        elif len(res) == 0:
628
+            return None
627 629
         return res[0]
628 630
 
629 631
         

Loading…
Anuluj
Zapisz