plugin ad-hoc D-Bus: fixed warning when no media player is found

This commit is contained in:
Goffi 2019-07-19 17:07:56 +02:00
commit 9487b0534b
2 changed files with 4 additions and 1 deletions

View file

@ -313,7 +313,8 @@ class Discovery(object):
"""Return entities (including jid_ and its items) offering features
@param features: iterable of features which must be present
@param identity(None, tuple(unicode, unicode)): if not None, accept only this (category/type) identity
@param identity(None, tuple(unicode, unicode)): if not None, accept only this
(category/type) identity
@param jid_: the jid of the target server (None for profile's server)
@param profile: %(doc_profile)s
@return: a set of found entities

View file

@ -346,6 +346,8 @@ class AdHocDBus(object):
NS_MEDIA_PLAYER, timeout=5)
command_elt = self._c.getCommandElt(result_elt)
form = data_form.findForm(command_elt, NS_MEDIA_PLAYER)
if form is None:
continue
mp_options = form.fields['media_player'].options
session_id = command_elt.getAttribute('sessionid')
if mp_options and session_id: