Skip to content

fix: use get() method for layer type checks in inspector_gui to avoid KeyError#1327

Merged
giswqs merged 1 commit into
masterfrom
cog
May 24, 2026
Merged

fix: use get() method for layer type checks in inspector_gui to avoid KeyError#1327
giswqs merged 1 commit into
masterfrom
cog

Conversation

@giswqs

@giswqs giswqs commented May 24, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 24, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 inspector GUI’s layer-type branching logic in leafmap by avoiding KeyError when a layer dictionary lacks a "type" key, and adds a clear fallback message for unknown/missing types.

Changes:

  • Replaced direct layer_dict["type"] lookups with layer_dict.get("type") in inspector interaction handling.
  • Added an explicit fallback branch that clears the output and reports “Unsupported layer type” when the layer type is missing or unrecognized.

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

@github-actions

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 24, 2026 03:46 Inactive
@giswqs giswqs merged commit 463b46e into master May 24, 2026
18 checks passed
@giswqs giswqs deleted the cog branch May 24, 2026 03:47
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.

2 participants