You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The html2Text handle calls feed that use replace function on given data (None).
Steps to reproduce
Steps to reproduce the behavior:
Try to integrate an Acunetix 360 json report with field RemedialProcedure set to null or any other property using html2Text converter
Expected behavior
Check that the value exists and is not None before calling html2Text handler.
Deployment method(select with an X)
Docker Compose
Kubernetes
GoDojo
Logs
[20/Jun/2024 06:16:33] ERROR [dojo.api_v2.exception_handler:43] 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 19, in create
self.perform_create(serializer)
File "/app/dojo/api_v2/views.py", line 2801, in perform_create
serializer.save(push_to_jira=push_to_jira)
File "/app/dojo/api_v2/serializers.py", line 2590, in save
self.process_scan(auto_create_manager, data, context)
File "/app/dojo/api_v2/serializers.py", line 2542, in process_scan
).process_scan(
^^^^^^^^^^^^^
File "/app/dojo/importers/default_reimporter.py", line 93, in process_scan
self.parsed_findings = self.parse_findings(scan, parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/importers/base_importer.py", line 222, in parse_findings
self.parsed_findings = self.parse_findings_static_test_type(scan, parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/importers/default_reimporter.py", line 291, in parse_findings_static_test_type
returnsuper().parse_findings_static_test_type(scan, parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/importers/base_importer.py", line 160, in parse_findings_static_test_type
return parser.get_findings(scan, self.test)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/tools/acunetix/parser.py", line 21, in get_findings
returnAcunetixJSONParser().get_findings(filename, test)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dojo/tools/acunetix/parse_acunetix360_json.py", line 32, in get_findings
mitigation = text_maker.handle(item.get("RemedialProcedure", ""))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/html2text/__init__.py", line 145, in handle
self.feed(data)
File "/usr/local/lib/python3.11/site-packages/html2text/__init__.py", line 140, in feed
data = data.replace("</' + 'script>", "</ignore>")
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'
Bug description
This error occurs each time html2text.HTML2Text() is used with a property get with default value but the property exists and is null
The html2Text
handle
callsfeed
that usereplace
function on given data (None
).Steps to reproduce
Steps to reproduce the behavior:
Try to integrate an Acunetix 360 json report with field
RemedialProcedure
set tonull
or any other property using html2Text converterExpected behavior
Check that the value exists and is not
None
before calling html2Text handler.Deployment method (select with an
X
)Logs
Sample scan files
The text was updated successfully, but these errors were encountered: