Skip to content

Commit f53e951

Browse files
authored
FIRIAMDefaultDisplayImpl: validate bundleURL to prevent crash. (#3593) (#3603)
1 parent 9a0fb0f commit f53e951

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Firebase/InAppMessagingDisplay/FIRIAMDefaultDisplayImpl.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ + (NSBundle *)getViewResourceBundle {
5858
// This is assuming the display resource bundle is contained in the main bundle
5959
NSURL *bundleURL = [containingBundle URLForResource:@"InAppMessagingDisplayResources"
6060
withExtension:@"bundle"];
61+
if (bundleURL == nil) {
62+
FIRLogWarning(kFIRLoggerInAppMessagingDisplay, @"I-FID100007",
63+
@"FIAM Display Resource bundle "
64+
"is missing: not contained within bundle %@",
65+
containingBundle);
66+
}
67+
6168
resourceBundle = [NSBundle bundleWithURL:bundleURL];
6269

6370
if (resourceBundle == nil) {

0 commit comments

Comments
 (0)