Fix TypeError when JSON table contains array instead of hash
What does this MR do and why?
Problem
Sentry error: https://new-sentry.gitlab.net/organizations/gitlab/issues/1815052
TypeError: no implicit conversion of String into Integer (TypeError)
return unless json['markdown']
^^^^^^^^^^
from lib/banzai/filter/json_table_filter.rb:47:in `process_json_table'
from lib/banzai/filter/json_table_filter.rb:26:in `block in call'
Solution
Check that parsed JSON is a Hash before accessing string keys to prevent TypeError when JSON contains an array.
How to set up and validate locally
- Open any issue or merge request
- Leave a comment with this content
- It should be rendered as an empty table instead of an error
| Before | After |
|---|---|
![]() |
![]() |
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Vasilii Iakliushin


