Skip to content

Commit 0e4ffb6

Browse files
authored
Make screenshotUris non-optional. (#1188)
If omitted, default to an empty list.
1 parent d22ff20 commit 0e4ffb6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/v2/providers/alerts/appDistribution.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface InAppFeedbackPayload {
7272
/** Text entered by the tester */
7373
text: string;
7474
/** URIs to download screenshot(s) */
75-
screenshotUris?: string[];
75+
screenshotUris: string[];
7676
}
7777

7878
/**
@@ -330,7 +330,10 @@ export function onInAppFeedbackPublished(
330330
const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);
331331

332332
const func = (raw: CloudEvent<unknown>) => {
333-
return handler(raw as AppDistributionEvent<InAppFeedbackPayload>);
333+
const event = raw as AppDistributionEvent<InAppFeedbackPayload>;
334+
// Consolidate the case of empty array and null array
335+
event.data.payload.screenshotUris = event.data.payload.screenshotUris || [];
336+
return handler(event);
334337
};
335338

336339
func.run = handler;

0 commit comments

Comments
 (0)