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

Uses dict.get() to avoid KeyError in TPDBMarkers plugin #484

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gq1869
Copy link

@gq1869 gq1869 commented Jan 13, 2025

When the 'movies' key doesn't exist in the scene dictionary, a KeyError is thrown.

if settings["createMovieFromScene"] and len(scene["movies"]) ==0:

Instead, we can use the get() method, which will return None (or other default value) if the key does not exist, instead of raising a KeyError.

len(scene["movies"]) >> len(scene.get("movies", []))


Resolves #440. Resolves #455.

@gq1869 gq1869 marked this pull request as ready for review January 13, 2025 05:00
@gq1869
Copy link
Author

gq1869 commented Jan 13, 2025

@Tweeticoats — FYI

@DogmaDragon — review request, please! TY!

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.

TPDBMarkers throws errors continuously TPDBMarkers Issue - Exit Code 120
1 participant