From 9c4629f66f9ecb42a929db93d1bbabb68c20561f Mon Sep 17 00:00:00 2001 From: Nuno Baldaia Date: Wed, 11 Jan 2017 17:16:54 +0000 Subject: [PATCH] Fixing a potencial crash --- NBReorderTableView.podspec | 2 +- NBReorderTableView/NBReorderTableView.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NBReorderTableView.podspec b/NBReorderTableView.podspec index f4c3a81..df2a580 100644 --- a/NBReorderTableView.podspec +++ b/NBReorderTableView.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "NBReorderTableView" - s.version = "0.1.6" + s.version = "0.1.7" s.summary = "Reorder table view cells with long press." s.description = <<-DESC NBReorderTableView is a `UITableView` subclass to support reordering cells with long press. diff --git a/NBReorderTableView/NBReorderTableView.m b/NBReorderTableView/NBReorderTableView.m index f7aa2a4..928fec7 100755 --- a/NBReorderTableView/NBReorderTableView.m +++ b/NBReorderTableView/NBReorderTableView.m @@ -182,7 +182,7 @@ - (void)finishMovingCell [self.timerToAutoscroll invalidate]; self.timerToAutoscroll = nil; // Inform the delegate that the reordering will finish - if ([self.delegate respondsToSelector:@selector(tableView:willFinishReorderingCellAtIndexPath:)]) { + if (self.movingIndexPath != nil && [self.delegate respondsToSelector:@selector(tableView:willFinishReorderingCellAtIndexPath:)]) { [self.delegate tableView:self willFinishReorderingCellAtIndexPath:self.movingIndexPath]; }