diff --git a/Source/Details/ASGraphicsContext.m b/Source/Details/ASGraphicsContext.m index f87102fab..3aaa14c09 100644 --- a/Source/Details/ASGraphicsContext.m +++ b/Source/Details/ASGraphicsContext.m @@ -154,7 +154,8 @@ extern void ASGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGF dispatch_once(&onceToken, ^{ UIGraphicsBeginImageContextWithOptions(CGSizeMake(1, 1), YES, 0); UIImage *refImage = UIGraphicsGetImageFromCurrentImageContext(); - imageColorSpace = CGImageGetColorSpace(refImage.CGImage); + imageColorSpace = CGColorSpaceRetain(CGImageGetColorSpace(refImage.CGImage)); + ASDisplayNodeCAssertNotNil(imageColorSpace, nil); UIGraphicsEndImageContext(); });