[flink] Protect against expired statement in check_status
@@ -148,10 +148,11 @@ class FlinkSqlApi(Api):
global n
response = {}
session = self._get_session()
- statement_id = snippet['result']['handle']['guid']
status = 'expired'
+ if snippet.get('result'):
+ statement_id = snippet['result']['handle']['guid']
if session:
if not statement_id: # Sync result
status = 'available'
