From 7585c21901304e4fb76649120e596d8bbdb6f28f Mon Sep 17 00:00:00 2001 From: jlwoolf Date: Wed, 21 Sep 2022 19:08:57 -0600 Subject: [PATCH] added exceptions to pass tests --- src/PIL/CurImagePlugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PIL/CurImagePlugin.py b/src/PIL/CurImagePlugin.py index 5d2ac7253..7797e7761 100644 --- a/src/PIL/CurImagePlugin.py +++ b/src/PIL/CurImagePlugin.py @@ -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()