korbit-ai[bot] commented on code in PR #36054:
URL: https://github.com/apache/superset/pull/36054#discussion_r2510275539


##########
superset-frontend/src/features/home/RightMenu.tsx:
##########
@@ -477,7 +477,7 @@ const RightMenu = ({
           userItems.push({
             key: 'info',
             label: (
-              <Typography.Link href={navbarRight.user_info_url}>
+              <Typography.Link href={ensureAppRoot(navbarRight.user_info_url)}>

Review Comment:
   ### Missing null check before ensureAppRoot call <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The ensureAppRoot function is called on navbarRight.user_info_url without 
null/undefined checking, which could cause a runtime error if user_info_url is 
null or undefined.
   
   
   ###### Why this matters
   If navbarRight.user_info_url is null or undefined, passing it to 
ensureAppRoot could result in unexpected behavior or runtime errors, 
potentially breaking the user info link functionality.
   
   ###### Suggested change ∙ *Feature Preview*
   Add a null check before calling ensureAppRoot:
   ```typescript
   <Typography.Link href={navbarRight.user_info_url ? 
ensureAppRoot(navbarRight.user_info_url) : '#'}>
   ```
   Or ensure the conditional check above properly handles the null case by 
changing the condition to check for truthy values:
   ```typescript
   if (navbarRight.user_info_url) {
     userItems.push({
       key: 'info',
       label: (
         <Typography.Link href={ensureAppRoot(navbarRight.user_info_url)}>
           {t('Info')}
         </Typography.Link>
       ),
     });
   }
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1bb00183-9793-4495-8e31-93055903eea6/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1bb00183-9793-4495-8e31-93055903eea6?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1bb00183-9793-4495-8e31-93055903eea6?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1bb00183-9793-4495-8e31-93055903eea6?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/1bb00183-9793-4495-8e31-93055903eea6)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:ea842276-653d-41ba-8d71-42e05b960a54 -->
   
   
   [](ea842276-653d-41ba-8d71-42e05b960a54)



-- 
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]

Reply via email to