Parcourir la source

Be robust against nil transactions in FLEXNetworkTransactionTableViewCell

Ryan Olson il y a 10 ans
Parent
commit
b0b64c1ba9
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  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];
     }