Skip to content

Commit d0e3aa5

Browse files
committed
Protect CPTLayer against invalid rendering context. Fixed issue core-plot#133.
1 parent 945fba7 commit d0e3aa5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

framework/Source/CPTLayer.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,14 @@ -(void)display
305305

306306
-(void)drawInContext:(CGContextRef)context
307307
{
308-
self.useFastRendering = YES;
309-
[self renderAsVectorInContext:context];
310-
self.useFastRendering = NO;
308+
if ( context ) {
309+
self.useFastRendering = YES;
310+
[self renderAsVectorInContext:context];
311+
self.useFastRendering = NO;
312+
}
313+
else {
314+
NSLog(@"%@: Tried to draw into a NULL context", self);
315+
}
311316
}
312317

313318
/// @endcond

0 commit comments

Comments
 (0)