Skip to content

Commit

Permalink
Fix TypeError: 'NoneType' object is not iterable
Browse files Browse the repository at this point in the history
Fix TypeError: 'NoneType' object is not iterable

Traceback (most recent call last):
  File ".../masoniteorm/connections/MSSQLConnection.py", line 156, in query
    return dict(zip(columnNames, result))
                ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
  • Loading branch information
cgslivre authored Sep 30, 2023
1 parent a1121ce commit 0e0ead2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/masoniteorm/connections/MSSQLConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def query(self, query, bindings=(), results="*"):
return {}
columnNames = [column[0] for column in cursor.description]
result = cursor.fetchone()
return dict(zip(columnNames, result))
return dict(zip(columnNames, result)) if result != None else {}
else:
if not cursor.description:
return {}
Expand Down

0 comments on commit 0e0ead2

Please sign in to comment.