summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r--sqlparse/sql.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index 4b78a92..5054128 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -418,7 +418,8 @@ class Statement(TokenList):
if isinstance(token, (Identifier, IdentifierList)):
_, dml_keyword = self.token_next(tidx, skip_ws=True)
- if dml_keyword.ttype == T.Keyword.DML:
+ if dml_keyword is not None \
+ and dml_keyword.ttype == T.Keyword.DML:
return dml_keyword.normalized
# Hmm, probably invalid syntax, so return unknown.