[PR #5855] [CLOSED] fix: add null check for inheritedAuth in TeamsSearch.service.ts #5383

Closed
opened 2026-03-17 02:50:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5855
Author: @themavik
Created: 2/10/2026
Status: Closed

Base: mainHead: fix/teams-search-auth-type-crash-5841


📝 Commits (1)

  • 0e1c306 fix: add null check for inheritedAuth in TeamsSearch.service

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts (+1 -1)

📄 Description

Summary

Fixes #5841.

When opening a request from search panel results, the findInheritableParentAuth method in TeamsSearch.service.ts accesses inheritedAuth.authType without checking if inheritedAuth (i.e., parentInheritedData.auth) is defined.

If a collection's data JSON doesn't contain an auth field, parentInheritedData.auth is undefined, causing:

TypeError: Cannot read properties of undefined (reading 'authType')

Fix

Added a null check: if (inheritedAuth && inheritedAuth.authType !== "inherit") to guard against undefined auth data in the parsed collection JSON.


Summary by cubic

Prevent crash when opening a request from search results by adding a null check for inheritedAuth in TeamsSearch.service. Fixes #5841.

Written for commit 0e1c3068cd. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5855 **Author:** [@themavik](https://github.com/themavik) **Created:** 2/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/teams-search-auth-type-crash-5841` --- ### 📝 Commits (1) - [`0e1c306`](https://github.com/hoppscotch/hoppscotch/commit/0e1c3068cde8229931607e3dfe6766f5edf50a9c) fix: add null check for inheritedAuth in TeamsSearch.service ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts` (+1 -1) </details> ### 📄 Description ## Summary Fixes #5841. When opening a request from search panel results, the `findInheritableParentAuth` method in `TeamsSearch.service.ts` accesses `inheritedAuth.authType` without checking if `inheritedAuth` (i.e., `parentInheritedData.auth`) is defined. If a collection's `data` JSON doesn't contain an `auth` field, `parentInheritedData.auth` is `undefined`, causing: ``` TypeError: Cannot read properties of undefined (reading 'authType') ``` ## Fix Added a null check: `if (inheritedAuth && inheritedAuth.authType !== "inherit")` to guard against undefined `auth` data in the parsed collection JSON. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevent crash when opening a request from search results by adding a null check for inheritedAuth in TeamsSearch.service. Fixes #5841. <sup>Written for commit 0e1c3068cde8229931607e3dfe6766f5edf50a9c. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:50:09 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5383
No description provided.