Skip to content

Fix a crash in get_image_close_to when a tile has no features#140

Merged
Rubix982 merged 1 commit intomapillary:mainfrom
tijszwinkels:fix-crash-on-empty-tile
May 2, 2022
Merged

Fix a crash in get_image_close_to when a tile has no features#140
Rubix982 merged 1 commit intomapillary:mainfrom
tijszwinkels:fix-crash-on-empty-tile

Conversation

@tijszwinkels
Copy link
Contributor

Tiny bugfix; When calling get_image_close_to, the library would crash when the received tile was empty, with a message like this:

  File "/usr/local/lib/python3.9/site-packages/mapillary/utils/auth.py", line 59, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/mapillary/interface.py", line 110, in get_image_close_to
    return image.get_image_close_to_controller(
  File "/usr/local/lib/python3.9/site-packages/mapillary/controller/image.py", line 134, in get_image_close_to_controller
    and unfiltered_data["features"][0]["properties"] != {}
IndexError: list index out of range

this MR fixes this crash.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2022
@tijszwinkels tijszwinkels changed the title Fix a crash in get_image_close_to when a tile has no featues Fix a crash in get_image_close_to when a tile has no features May 1, 2022
@tijszwinkels
Copy link
Contributor Author

Build failed on building documentation, but no documentation changed.
Failing check is unrelated.

@Rubix982
Copy link
Contributor

Rubix982 commented May 2, 2022

Thanks for the PR, @tijszwinkels.

Sure, this is an easy merge.

The documentation workflow fails if no part of the documentation is altered, hence the fail signals that there needs nothing to be done. The documentation is generated from the source code (.py) files. So the fail is okay and can be disregarded.

@Rubix982 Rubix982 merged commit 4628a5c into mapillary:main May 2, 2022
Rubix982 added a commit that referenced this pull request May 2, 2022
Patch release due to bug fix in #140.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants