소스 검색

HUE-8431 [index] Avoid TypeError: 'NoneType' object is not iterable when list aliases is null

Romain Rigaux 7 년 전
부모
커밋
697de9c6d6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/libs/libsolr/src/libsolr/api.py

+ 1 - 1
desktop/libs/libsolr/src/libsolr/api.py

@@ -458,7 +458,7 @@ class SolrApi(object):
           ('action', 'LISTALIASES'),
           ('wt', 'json'),
       )
-      return self._root.get('admin/collections', params=params)['aliases']
+      return self._root.get('admin/collections', params=params)['aliases'] or []
     except RestException, e:
       raise PopupException(e, title=_('Error while accessing Solr'))