Просмотр исходного кода

Be robust against nil transactions in FLEXNetworkTransactionTableViewCell

Ryan Olson лет назад: 10
Родитель
Сommit
b0b64c1ba9
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      Classes/Network/FLEXNetworkTransactionTableViewCell.m

+ 4 - 2
Classes/Network/FLEXNetworkTransactionTableViewCell.m

@@ -127,11 +127,13 @@ NSString *const kFLEXNetworkTransactionCellIdentifier = @"kFLEXNetworkTransactio
     NSMutableArray *detailComponents = [NSMutableArray array];
 
     NSString *timestamp = [[self class] timestampStringFromRequestDate:self.transaction.startTime];
-    [detailComponents addObject:timestamp];
+    if ([timestamp length] > 0) {
+        [detailComponents addObject:timestamp];
+    }
 
     // Omit method for GET (assumed as default)
     NSString *httpMethod = self.transaction.request.HTTPMethod;
-    if (httpMethod) {
+    if ([httpMethod length] > 0) {
         [detailComponents addObject:httpMethod];
     }