From 2964053c7322cb8bb1ed305d44f75a4fe8101637 Mon Sep 17 00:00:00 2001 From: apwelsh Date: Thu, 13 Apr 2017 00:28:49 -0700 Subject: [PATCH] Fix nil argument error in initializer It is possible to add a Subview of nil. this fix does not add the lineView, if the lineView is nil. --- LMAlertView/LMAlertView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LMAlertView/LMAlertView.m b/LMAlertView/LMAlertView.m index 2ad40d3..e41e4f4 100644 --- a/LMAlertView/LMAlertView.m +++ b/LMAlertView/LMAlertView.m @@ -259,7 +259,9 @@ - (void)setupWithTitle:(NSString *)title message:(NSString *)message cancelButto [self.contentView addSubview:self.messageLabel]; [self.contentView addSubview:self.buttonTableView]; [self.contentView addSubview:self.otherTableView]; - [self.contentView addSubview:lineView]; + if (lineView) { + [self.contentView addSubview:lineView]; + } } - (void)setSize:(CGSize)size animated:(BOOL)animated