Skip to content

Commit 3c4cab5

Browse files
committed
Add fallback to empty notification response
1 parent 3f482a2 commit 3c4cab5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-renderer-demo/src/components/notification-panel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ const getNotifications = () => {
4141
return fetch(`https://data-driven-forms.firebaseio.com/notifications.json${query}`)
4242
.then((data) => data.json())
4343
.then((data) => {
44+
if (!data) {
45+
return [];
46+
}
47+
4448
if (typeof data !== 'object') {
4549
return [];
4650
}

0 commit comments

Comments
 (0)