Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve 'NoneType' object has no attribute 'id'Traceback in django_mark_safe #598

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion bandit/plugins/django_xss.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def is_assigned(self, node):
assigned = self.is_assigned_in(node.body)
else:
for withitem in node.items:
if withitem.optional_vars.id == self.var_name.id:
var_id = getattr(withitem.optional_vars, 'id', None)
if var_id == self.var_name.id:
assigned = node
else:
assigned = self.is_assigned_in(node.body)
Expand Down