Repository: firebase/firebase-ios-sdk (language: cpp)

Issue:
App crashed on failed to fetch InAppMessaging image
<!-- DO NOT DELETE
validate_template=true
template_path=.github/ISSUE_TEMPLATE/bug_report.md
-->
### Step 0: Are you in the right place?
Yes

### [REQUIRED] Step 1: Describe your environment

  * Xcode version: 12.3 (12C33)
  * Firebase SDK version: 7.3.0
  * Installation method: CocoaPods
  * Firebase Component:  Messaging

### [REQUIRED] Step 2: Describe the problem
I published a test campaign but app crashed when the event fired. I guess it should be silent even if the image is invalid.
#### Steps to reproduce:

Error in fetching image: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x283ba2af0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x281791c70 [0x1e707b730]>{length = 16, capacity = 16, bytes = 0x100201bb98c726720000000000000000}, _kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://techcrunch.com/wp-content/uploads/2019/05/Screen-Shot-2019-05-22-at-8.43.37-AM.jpg, NSErrorFailingURLKey=https://techcrunch.com/wp-content/uploads/2019/05/Screen-Shot-2019-05-22-at-8.43.37-AM.jpg, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=53, NSLocalizedDescription=The network connection was lost.}

Error in loading image data for the message.

The callstack exception message is: Image data should never nil for a valid card message.

#### Relevant Code:

No code


Discussion / hints:

Fix patch:
diff --git a/FirebaseInAppMessaging/CHANGELOG.md b/FirebaseInAppMessaging/CHANGELOG.md
index f81d8c5060f..2efed22e6d3 100644
--- a/FirebaseInAppMessaging/CHANGELOG.md
+++ b/FirebaseInAppMessaging/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 2021-1 -- v7.5.0
+- [fixed] Fixed failed assertion causing app to crash during test on device flow (#7299).
+
 # 2020-12 -- v7.3.0
 - [fixed] Fixed default display bug in apps that don't use `UISceneDelegate` (#6803).
 
diff --git a/FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m b/FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m
index e3e766a1d03..d37698c3c4d 100644
--- a/FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m
+++ b/FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m
@@ -423,7 +423,7 @@ - (void)checkAndDisplayNextContextualMessageForAnalyticsEvent:(NSString *)eventN
 
 - (FIRInAppMessagingCardDisplay *)
     cardDisplayMessageWithMessageDefinition:(FIRIAMMessageDefinition *)definition
-                          portraitImageData:(nonnull FIRInAppMessagingImageData *)portraitImageData
+                          portraitImageData:(FIRInAppMessagingImageData *)portraitImageData
                          landscapeImageData:
                              (nullable FIRInAppMessagingImageData *)landscapeImageData
                                 triggerType:(FIRInAppMessagingDisplayTriggerType)triggerType {
@@ -573,9 +573,8 @@ - (void)checkAndDisplayNextContextualMessageForAnalyticsEvent:(NSString *)eventN
                             triggerType:(FIRInAppMessagingDisplayTriggerType)triggerType {
   switch (definition.renderData.renderingEffectSettings.viewMode) {
     case FIRIAMRenderAsCardView:
-      // Image data should never nil for a valid card message.
       if (imageData == nil) {
-        NSAssert(NO, @"Image data should never nil for a valid card message.");
+        // Image data should never nil for a valid card message.
         return nil;
       }
       return [self cardDisplayMessageWithMessageDefinition:definition


Test patch: