Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin crashes when "type" field is not present on assets #227

Open
chrsphr opened this issue Feb 16, 2023 · 1 comment
Open

Plugin crashes when "type" field is not present on assets #227

chrsphr opened this issue Feb 16, 2023 · 1 comment

Comments

@chrsphr
Copy link

chrsphr commented Feb 16, 2023

Plugin crashes after pressing 'View assets' on an item, where the item has assets which have the 'type' field missing.
The type field is not strictly required for assets, so we should be able to handle this

https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-object

image

@emilyselwood
Copy link

Had a short look to see if this could be hunted down easily...

While making the field optional in the AssetWidget is reasonably easy, with out knowing the type it will never be able to actually load it. It uses the type as a mapping against the AssetLayerType enum to figure out what it is loading. Given the type is not required in the spec this likely needs an attempt to guess at the type from the asset file extension as well.

This seems like a bigger change and should be discussed first.

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

No branches or pull requests

2 participants