ReplApplication.get_object(): return None if method does not exist
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
6842dda4cc
commit
e15b2a8473
1 changed files with 9 additions and 2 deletions
|
|
@ -237,11 +237,18 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
try:
|
||||
obj = self.objects[int(_id) - 1]
|
||||
except (IndexError, ValueError):
|
||||
pass
|
||||
return None
|
||||
else:
|
||||
try:
|
||||
backend = self.weboob.get_backend(obj.backend)
|
||||
return backend.fillobj(obj, fields)
|
||||
actual_method = getattr(backend,method,None)
|
||||
if actual_method is None:
|
||||
return None
|
||||
else:
|
||||
if callable(actual_method):
|
||||
return backend.fillobj(obj, fields)
|
||||
else:
|
||||
return None
|
||||
except UserError as e:
|
||||
self.bcall_error_handler(backend, e, '')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue