This repository was archived by the owner on May 27, 2021. It is now read-only.

Description
Currently, when passing something such as:
notify_user:
action: msexchange.send_email
input:
log_level: DEBUG
body: "<% ctx().email_body %>"
subject: "<% ctx().subject %>"
to_recipients: <% ctx().to_recipients %>
Where to_recipients expects a list, even if the YAQL query returns a list, react fails to render and the screen goes permanently white until a full page reload.
The error happens here:
|
return v ? v.join(', ') : ''; |

The exact error is

From what I understand, the method just does not expect that v could be a bad string.
A quick fix would be to do a type check before attempting to return a value.
toStateValue(v) {
if (jsonCheck(v)) {
return JSON.stringify(v);
}
if (isJinja(v)) {
return v;
}
const { secret } = this.props.spec || {};
if (secret && v && !Array.isArray(v)) {
return v;
}
if(v == null) {
return '';
}
if(!Array.isArray(v)) {
// "Invalid Value"
}
return v.join(', ');
}