diff --git a/frontend/src/metabase/lib/pulse.js b/frontend/src/metabase/lib/pulse.js index b7bb3b501a4a9aff1999e9d87d22adaefb1fc884..e3f81da2a2240da1556e802b5c43490efad3392b 100644 --- a/frontend/src/metabase/lib/pulse.js +++ b/frontend/src/metabase/lib/pulse.js @@ -19,7 +19,7 @@ export function channelIsValid(channel, channelSpec) { } if (channelSpec.fields) { for (let field of channelSpec.fields) { - if (field.required && (channel.details[field.name] == null || channel.details[field.name] == "")) { + if (field.required && channel.details && (channel.details[field.name] == null || channel.details[field.name] == "")) { return false; } } diff --git a/frontend/src/metabase/pulse/components/PulseEdit.jsx b/frontend/src/metabase/pulse/components/PulseEdit.jsx index 35020575e65da90997c7904bf2a34178608e8379..e4065ce17026888e44b281a3b6cdaf04c1831825 100644 --- a/frontend/src/metabase/pulse/components/PulseEdit.jsx +++ b/frontend/src/metabase/pulse/components/PulseEdit.jsx @@ -84,7 +84,7 @@ export default class PulseEdit extends Component { c.channel_type === "email" ? <span>This pulse will no longer be emailed to <strong>{c.recipients.length} {inflect("address", c.recipients.length)}</strong> <strong>{c.schedule_type}</strong>.</span> : c.channel_type === "slack" ? - <span>Slack channel <strong>{c.details.channel}</strong> will no longer get this pulse <strong>{c.schedule_type}</strong>.</span> + <span>Slack channel <strong>{c.details && c.details.channel}</strong> will no longer get this pulse <strong>{c.schedule_type}</strong>.</span> : <span>Channel <strong>{c.channel_type}</strong> will no longer receive this pulse <strong>{c.schedule_type}</strong>.</span> ); diff --git a/frontend/src/metabase/pulse/components/PulseEditChannels.jsx b/frontend/src/metabase/pulse/components/PulseEditChannels.jsx index 1af8d8e9d6f6ff11acad0bb59ee1a6470f0ef055..f662a365dc356cf7cbfd4664c6e3e55e847f0b6b 100644 --- a/frontend/src/metabase/pulse/components/PulseEditChannels.jsx +++ b/frontend/src/metabase/pulse/components/PulseEditChannels.jsx @@ -155,10 +155,11 @@ export default class PulseEditChannels extends Component { { field.type === "select" ? <Select className="h4 text-bold bg-white" - value={channel.details[field.name]} + value={channel.details && channel.details[field.name]} options={field.options} optionNameFn={o => o} optionValueFn={o => o} + // Address #5799 where `details` object is missing for some reason onChange={(o) => this.onChannelPropertyChange(index, "details", { ...channel.details, [field.name]: o })} /> : null } diff --git a/frontend/src/metabase/pulse/components/PulseListChannel.jsx b/frontend/src/metabase/pulse/components/PulseListChannel.jsx index e7775c1bc330d5df1c9ec22295e2121d10bae5b0..3a8e3841eecb712134a39a73e6a1afa35faf9c98 100644 --- a/frontend/src/metabase/pulse/components/PulseListChannel.jsx +++ b/frontend/src/metabase/pulse/components/PulseListChannel.jsx @@ -56,7 +56,8 @@ export default class PulseListChannel extends Component { } else if (channel.channel_type === "slack") { channelIcon = "slack"; channelVerb = "Slack'd"; - channelTarget = channel.details.channel; + // Address #5799 where `details` object is missing for some reason + channelTarget = channel.details ? channel.details.channel : "No channel"; } return (