added exceptions to pass tests

This commit is contained in:
jlwoolf 2022-09-21 19:08:57 -06:00
parent a18bb13f07
commit 7585c21901

View File

@ -177,7 +177,10 @@ class CurImageFile(IcoImagePlugin.IcoImageFile):
self.ico = CurFile(self.fp)
self.info["sizes"] = self.ico.sizes()
self.info["hotspots"] = self.ico.hotspots()
self.size = self.ico.entry[0]["dim"]
if len(self.ico.entry) > 0:
self.size = self.ico.entry[0]["dim"]
else:
raise TypeError("No cursors were found")
self.load()