Validate self.palette in has_transparency_data()

This commit is contained in:
gdesmar 2024-02-13 16:46:58 +00:00
parent 50e9a92c98
commit 92e57889d0
No known key found for this signature in database
GPG Key ID: 99E35CDA9095D6BC

View File

@ -1561,7 +1561,7 @@ class Image:
"""
return (
self.mode in ("LA", "La", "PA", "RGBA", "RGBa")
or (self.mode == "P" and self.palette.mode.endswith("A"))
or (self.mode == "P" and self.palette and self.palette.mode.endswith("A"))
or "transparency" in self.info
)