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)