From 803e1b97ae420ecdb6bde7e4b85592e3f4a1ee31 Mon Sep 17 00:00:00 2001 From: Vignesh Renganathan Date: Fri, 23 Feb 2018 18:01:39 +0530 Subject: [PATCH] When reading the empty cell. the app crashes --- XlsxReaderWriter/BRACell.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/XlsxReaderWriter/BRACell.m b/XlsxReaderWriter/BRACell.m index f37bf2d..259d6c8 100644 --- a/XlsxReaderWriter/BRACell.m +++ b/XlsxReaderWriter/BRACell.m @@ -316,7 +316,12 @@ - (NSAttributedString *)attributedStringValue { return [[NSAttributedString alloc] initWithString:[df stringFromDate:_dateValue] attributes:attributedTextAttributes]; } else if (_type == BRACellContentTypeString) { - return [[NSAttributedString alloc] initWithString:_value attributes:attributedTextAttributes]; + @try { + return [[NSAttributedString alloc] initWithString:_value attributes:attributedTextAttributes]; + } + @catch (NSException * e) { + return [[NSAttributedString alloc] initWithString:@"" attributes:attributedTextAttributes]; + } } else if (_type == BRACellContentTypeInlineString) { // TODO : Not Implemented