From 309291563abfbe5269d156486ef11e537bb0c93d Mon Sep 17 00:00:00 2001 From: nulano Date: Sun, 19 Jan 2020 23:12:57 +0000 Subject: [PATCH] return None if display profile not found in ImageCms.get_display_profile --- src/PIL/ImageCms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index c26fd14f2..661c3f33b 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -263,6 +263,8 @@ def get_display_profile(handle=None): profile = core.get_display_profile_win32(handle, 1) else: profile = core.get_display_profile_win32(handle or 0) + if profile is None: + return None return ImageCmsProfile(profile)