Преглед изворни кода

Be robust against nil transactions in FLEXNetworkTransactionTableViewCell

Ryan Olson пре 10 година
родитељ
комит
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];
     }