Infer 8/1/18

Found 1134 issues.

NULL_DEREFERENCE

This leads to a crash.

Traveloka/Traveloka/travelokaPay/Common/Tracking/TVPDataNetworkManager.m:35: error: NULL_DEREFERENCE
  pointer `data` is annotated with _Nullable and is dereferenced without a null check at line 35, column 12.
  33.  
  34.   - (NSDictionary *)requestParametersWithContext:(NSDictionary *)context data:(nullable NSDictionary *)data {
  35. >     return @{
  36.                kTVPDataNetworkManagerClientInterface: kNetworkServiceClientInterface,
  37.                kTVPDataNetworkManagerContext: context,

Traveloka/Traveloka/Itinerary/Transaction/TransactionList/ViewModel/TransactionListCellViewModel.m:46: error: NULL_DEREFERENCE
  pointer `icon` last assigned on line 45 could be null and is dereferenced by call to `addObject:` at line 46, column 9.
  44.       for (NSString *itineraryType in mutableOrderedSet) {
  45.           UIImage *icon = [ProductIconHelper productIconImageSmallGreyWithType:itineraryType];
  46. >         [productIcons addObject:icon];
  47.       }
  48.    

Traveloka/Traveloka/Promo/PromoHotelListViewController.m:118: error: NULL_DEREFERENCE
  pointer `returned by hotelID` is indirectly marked _Nullable (source: `_hotelID`) and is dereferenced without a null check at line 118, column 46.
  116.      
  117.       [[TVLTrackingManager manager] trackEvent:INTERNAL_TRACKING_PAGE_PROMO_DETAIL_SELECTION
  118. >                                   parameters:@{@"promoId" : self.hotelData.value.promoPageHash,
  119.                                                  @"itemId" : promoOrderAtIndex.value.hotelID,
  120.                                                  @"position" : position,

ASSIGN_POINTER_WARNING

STRONG_DELEGATE_WARNING

This leads to a retain cycle.

PARAMETER_NOT_NULL_CHECKED

This leads to a crash.

Traveloka/Traveloka/Flight/Common/Model/BookingCreate/FlightBookingCreateResponse.m86:86: warning: PARAMETER_NOT_NULL_CHECKED
  Parameter `parameter` is not checked for null, there could be a null pointer dereference: pointer `phoneNumber` last assigned on line 81 could be null and is dereferenced at line 86, column 37.
  84.           phoneNumber = [Util phoneNumberWithPrefix:countryCode[0] number:phone];
  85.       }
  86. >     bookingContactValue[@"phone"] = @[phoneNumber];
  87.       bookingContactValue[@"personTitle"] = bookingContact[@"personTitle"];
  88.       if (bookingContact[@"lastName"]) {

Traveloka/Traveloka/Itinerary/Pre Issuance/PreIssuanceViewController.m:156: warning: PARAMETER_NOT_NULL_CHECKED
  Parameter `self` is not checked for null, there could be a null pointer dereference: pointer `bookingInfo` last assigned on line 155 could be null and is dereferenced by call to `initWithBookingInfo:` at line 156, column 57.
  154.              
  155.               BookingInfo *bookingInfo = self.currentBookingInfo;
  156. >             SubmitPaymentConfirmationRequest *request = [[SubmitPaymentConfirmationRequest alloc] initWithBookingInfo:bookingInfo];
  157.               request.paymentProof = self.documentFile;
  158.

POINTER_TO_CONST_OBJC_CLASS

UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK

Traveloka/Traveloka/Bus/Home/BusHomeView.m:158: error: UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK
  `The selector mas_safeAreaLayoutGuide` is not available in the required iOS SDK version `9.0` (only available from version `11.0`) at line 158, column 38. This could cause a crash.
  156.           make.top.leading.trailing.equalTo(bottomBarView).inset(16);
  157.           if ([UIView instancesRespondToSelector:@selector(safeAreaLayoutGuide)]) {
  158. >             make.bottom.equalTo(self.mas_safeAreaLayoutGuide).inset(16);
  159.           }
  160.           else {