ejabberd: Handle case where domain name is not set

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2019-11-06 05:42:24 +05:30 committed by Sunil Mohan Adapa
parent aaee9ec8a9
commit baa5a12c62
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -47,7 +47,8 @@ class EjabberdAppView(AppView):
def get_context_data(self, *args, **kwargs):
"""Add service to the context data."""
context = super().get_context_data(*args, **kwargs)
context['domainname'] = ejabberd.get_domains()[0]
domains = ejabberd.get_domains()
context['domainname'] = domains[0] if domains else None
context['clients'] = ejabberd.clients
return context