diff --git a/edx_lint/pylint/filters_docstring/filters_docstring_check.py b/edx_lint/pylint/filters_docstring/filters_docstring_check.py index 9457420..9527975 100644 --- a/edx_lint/pylint/filters_docstring/filters_docstring_check.py +++ b/edx_lint/pylint/filters_docstring/filters_docstring_check.py @@ -122,7 +122,11 @@ def _check_filter_type_missing_or_incorrect(self, node, docstring): If the filter type is missing or incorrect, return the error message. Otherwise, return. """ - filter_type = node.locals["filter_type"][0].statement().value.value + filter_type = node.locals.get("filter_type") + if not filter_type: + return self.DOCSTRING_MISSING_OR_INCORRECT_TYPE + + filter_type = filter_type[0].statement().value.value if filter_type else "" if not re.search(r"Filter Type:\s*%s" % filter_type, docstring): return self.DOCSTRING_MISSING_OR_INCORRECT_TYPE return None