[PR #137] [MERGED] fix: prevent 'undefined length' errors in 3gdetail.js #237

Closed
opened 2026-03-13 13:54:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/4IceG/luci-app-3ginfo-lite/pull/137
Author: @iqubik
Created: 3/11/2026
Status: Merged
Merged: 3/11/2026
Merged by: @4IceG

Base: mainHead: main


📝 Commits (3)

  • 7b09da5 Update print statement from 'Hello' to 'Goodbye'
  • 1c8dd4c Change greeting from 'Hello' to 'Goodbye'
  • 8d835ea Refactor SIMdata function for safer JSON parsing

📊 Changes

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

View changed files

📝 luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js (+34 -26)

📄 Description

This commit fixes a JS crash (Cannot read properties of undefined - reading 'length') on the main page and during BTS search:

  1. SIMdata: Added safety check sdata.simslot && sdata.simslot.length to prevent crashes when a modem does not return simslot info.
  2. o.onclick: Added check for searchsite existence (to handle uci get failures) and converted properties to Strings before checking length, preventing crashes if Cell ID or MNC/MCC are missing.

🔄 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/4IceG/luci-app-3ginfo-lite/pull/137 **Author:** [@iqubik](https://github.com/iqubik) **Created:** 3/11/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@4IceG](https://github.com/4IceG) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`7b09da5`](https://github.com/4IceG/luci-app-3ginfo-lite/commit/7b09da5df9b2cf6e3c0a14e998130611e916871d) Update print statement from 'Hello' to 'Goodbye' - [`1c8dd4c`](https://github.com/4IceG/luci-app-3ginfo-lite/commit/1c8dd4c11cb051cbedb1afc64838fdc1acaa4790) Change greeting from 'Hello' to 'Goodbye' - [`8d835ea`](https://github.com/4IceG/luci-app-3ginfo-lite/commit/8d835ea216f3175c4eeb5f51a477686edd3aad52) Refactor SIMdata function for safer JSON parsing ### 📊 Changes **1 file changed** (+34 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js` (+34 -26) </details> ### 📄 Description This commit fixes a JS crash (Cannot read properties of undefined - reading 'length') on the main page and during BTS search: 1. `SIMdata`: Added safety check `sdata.simslot && sdata.simslot.length` to prevent crashes when a modem does not return simslot info. 2. `o.onclick`: Added check for `searchsite` existence (to handle uci get failures) and converted properties to Strings before checking length, preventing crashes if Cell ID or MNC/MCC are missing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 13:54:57 +03:00
Sign in to join this conversation.
No labels
pull-request
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/luci-app-3ginfo-lite#237
No description provided.