From edf72dfb33715f5b011a12a2cc7f8cad04929163 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Sat, 30 Mar 2013 01:04:37 +0100 Subject: [PATCH] Do not try to fill None Use case: videoob play on an unknown URL. The get_object(... , ['url']) would throw a FieldNotFound, when the right error should be video not found. --- weboob/tools/backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weboob/tools/backend.py b/weboob/tools/backend.py index 5d9090a0..0b086763 100644 --- a/weboob/tools/backend.py +++ b/weboob/tools/backend.py @@ -354,6 +354,8 @@ class BaseBackend(object): :param fields: what fields to fill; if None, all fields are filled :type fields: :class:`list` """ + if obj is None: + return obj def not_loaded(v): return (v is NotLoaded or isinstance(v, CapBaseObject) and not v.__iscomplete__())