From 4726c3b91e9050d508a9c0da5bdbfcfd5de2c6c2 Mon Sep 17 00:00:00 2001 From: kudit Date: Mon, 17 Mar 2014 20:44:48 -0400 Subject: [PATCH] Added count check to prevent 0 count error This will crash when trying to get objectAtIndex: 0 if the count is 0 (of course!) --- OVGraphView/OVGraphView/OVGraphPlotView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OVGraphView/OVGraphView/OVGraphPlotView.m b/OVGraphView/OVGraphView/OVGraphPlotView.m index a6f2621..b86993a 100644 --- a/OVGraphView/OVGraphView/OVGraphPlotView.m +++ b/OVGraphView/OVGraphView/OVGraphPlotView.m @@ -129,7 +129,7 @@ - (void)drawRect:(CGRect)rect{ int prevxpoint=0; int prevypoint=0; int i=0; - if (_plotpoints!=nil) { + if (_plotpoints!=nil && [_plotpoints count] > 0) { for (OVGraphViewPoint *point in _plotpoints) { int xpoint; int ypoint;