瀏覽代碼

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 年之前
父節點
當前提交
949320298d
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      lodel/leapi/leobject.py

+ 2
- 0
lodel/leapi/leobject.py 查看文件

@@ -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…
取消
儲存