瀏覽代碼

[sqlalchemy] Avoid potential 'NoneType' object has no attribute 'poll'

Romain Rigaux 4 年之前
父節點
當前提交
2ed15ee345
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

+ 1 - 1
desktop/libs/notebook/src/notebook/connectors/sql_alchemy.py

@@ -317,7 +317,7 @@ class SqlAlchemyApi(Api):
       stats = None
       progress = 100
       try:
-        if handle:
+        if handle and handle['result'].cursor:
           stats = handle['result'].cursor.poll()
       except AssertionError as e:
         LOG.warn('Query probably not running anymore: %s' % e)