Skip to content

fix(scanArea): prevent crash when area feature has no name/key#1225

Merged
Mygod merged 2 commits into
WatWowMap:developfrom
pjorritsma:fix/scan-area-missing-name
Jul 5, 2026
Merged

fix(scanArea): prevent crash when area feature has no name/key#1225
Mygod merged 2 commits into
WatWowMap:developfrom
pjorritsma:fix/scan-area-missing-name

Conversation

@pjorritsma

Copy link
Copy Markdown
Contributor

Guard the scan area search filter against features missing a properties.key (which happens when a scan area polygon has no name set), instead of throwing TypeError: Cannot read properties of undefined (reading 'toLowerCase').

Also fixes a longstanding typo (geoJsonFilName / geoJsonFilname -> geoJsonFileName) in the multi-domain example config and docs.

Guard the scan area search filter against features missing a properties.key (which happens when a scan area polygon has no name set), instead of throwing TypeError: Cannot read properties of undefined (reading 'toLowerCase').

Also fixes a longstanding typo (geoJsonFilName / geoJsonFilname -> geoJsonFileName) in the multi-domain example config and docs.
Copilot AI review requested due to automatic review settings July 5, 2026 16:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the scan-area GeoJSON filtering logic to avoid a runtime crash when a scan-area feature lacks a properties.key, and it corrects a typo in the multi-domain example configs/docs so they match the actual geoJsonFileName setting used by the server config loader.

Changes:

  • Guard scan-area search filtering against missing properties.key to prevent toLowerCase() crashes.
  • Fix geoJsonFilName/geoJsonFilename typos to geoJsonFileName in multi-domain example configs and documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/features/scanArea/ScanAreaTile.jsx Adds a fallback when filtering features by properties.key during search.
config/multi-domain-example/README.md Updates docs to reference geoJsonFileName (and related wording).
config/multi-domain-example/local-orangemap.json Renames the example config key to geoJsonFileName.
config/multi-domain-example/local-applemap.json Renames the example config key to geoJsonFileName.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/scanArea/ScanAreaTile.jsx
Comment thread config/multi-domain-example/README.md Outdated
@Mygod Mygod merged commit f2d642b into WatWowMap:develop Jul 5, 2026
2 checks passed
Mygod added a commit that referenced this pull request Jul 5, 2026
#1226)

* fix(scanArea): prevent crash when area feature has no name/key

Guard the scan area search filter against features missing a properties.key (which happens when a scan area polygon has no name set), instead of throwing TypeError: Cannot read properties of undefined (reading 'toLowerCase').

Also fixes a longstanding typo (geoJsonFilName / geoJsonFilname -> geoJsonFileName) in the multi-domain example config and docs.

* fix: copilot comments

---------

Co-authored-by: turtlesocks-bot <turtlesocks-bot@users.noreply.github.com>
Co-authored-by: PJ0tter <pjorritsma@users.noreply.github.com>
github-actions Bot pushed a commit that referenced this pull request Jul 5, 2026
## [1.45.1](v1.45.0...v1.45.1) (2026-07-05)

### Bug Fixes

* **scanArea:** prevent crash when area feature has no name/key ([#1225](#1225)) ([#1226](#1226)) ([2df8c9e](2df8c9e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants