cjcodeproj / medialibrary

Python code to read XML media files
MIT License
2 stars 0 forks source link

Noun casefold bug #189

Closed cjcodeproj closed 3 months ago

cjcodeproj commented 3 months ago

In the main noun.py file, in the initializer of the Noun class object.

https://github.com/cjcodeproj/medialibrary/blob/f37e074d29e6ecdb38942ca38e92663f5176b7df/src/media/data/nouns.py#L88-L92

The code fails if the noun element passed has no valid. It tries to perform a caseload against a None object if there is no actual string in the element. If this is encountered while loading a repository, there will be a failure.

There should be a condition that catches this, and gracefully prevents it from happening.

Not sure if that means the noun should still have an empty value, or if it should contain a string like "INVALID STRING VALUE".

cjcodeproj commented 3 months ago

Coding Notes

For XML element objects, the .text attribute returns a None object if there is no text, instead of an empty string.

cjcodeproj commented 3 months ago

Commit:

https://github.com/cjcodeproj/medialibrary/commit/b3e542f40953cce948f98e82e43e97b01d3008f5