From e1d581c852c375908029f7f527f6458cd4bd2d35 Mon Sep 17 00:00:00 2001 From: Will Ferrel Date: Thu, 26 Mar 2015 19:29:46 -0400 Subject: [PATCH] Safely check if button has background color before adding --- SWTableViewCell.podspec | 2 +- SWTableViewCell/PodFiles/SWUtilityButtonView.m | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SWTableViewCell.podspec b/SWTableViewCell.podspec index a2291dc..524519e 100644 --- a/SWTableViewCell.podspec +++ b/SWTableViewCell.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SWTableViewCell' - s.version = '0.3.7' + s.version = '0.3.9' s.author = { 'Chris Wendel' => 'chriwend@umich.edu' } s.homepage = 'https://github.com/CEWendel/SWTableViewCell' s.summary = 'UITableViewCell subclass that implements a swipeable content view which exposes utility buttons.' diff --git a/SWTableViewCell/PodFiles/SWUtilityButtonView.m b/SWTableViewCell/PodFiles/SWUtilityButtonView.m index c36908f..eaa7fa0 100644 --- a/SWTableViewCell/PodFiles/SWUtilityButtonView.m +++ b/SWTableViewCell/PodFiles/SWUtilityButtonView.m @@ -132,7 +132,9 @@ - (void)pushBackgroundColors for (UIButton *button in self.utilityButtons) { - [self.buttonBackgroundColors addObject:button.backgroundColor]; + if (button.backgroundColor) { + [self.buttonBackgroundColors addObject:button.backgroundColor]; + } } }