korbit-ai[bot] commented on code in PR #34193:
URL: https://github.com/apache/superset/pull/34193#discussion_r2211430615
##########
superset-frontend/src/dashboard/components/Header/index.jsx:
##########
@@ -415,7 +415,7 @@ const Header = () => {
owners: dashboardInfo.owners,
roles: dashboardInfo.roles,
slug,
- tags: dashboardInfo.tags,
+ tags: dashboardInfo.tags.filter(item => item.type === 1 || !item.type),
Review Comment:
### Missing Null Check in Tag Filtering <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The tag filtering logic is hardcoded to only allow tags of type 1 or
undefined, without any fallback handling for edge cases where tags might be
null or undefined.
###### Why this matters
If dashboardInfo.tags is null or undefined, the filter operation will throw
an error and crash the dashboard. This could happen if the backend API fails to
provide tag data or during initial loading states.
###### Suggested change ∙ *Feature Preview*
Add a null check before filtering tags:
```javascript
tags: (dashboardInfo.tags || []).filter(item => item.type === 1 ||
!item.type)
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/160e2f6c-0b6a-4cc5-820a-c95fb936d6d0/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/160e2f6c-0b6a-4cc5-820a-c95fb936d6d0?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/160e2f6c-0b6a-4cc5-820a-c95fb936d6d0?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/160e2f6c-0b6a-4cc5-820a-c95fb936d6d0?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/160e2f6c-0b6a-4cc5-820a-c95fb936d6d0)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:22c2437d-9afb-453c-ba62-a1f9fb5e0bc0 -->
[](22c2437d-9afb-453c-ba62-a1f9fb5e0bc0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]