Fixed: Prevent unexpected data breaking Series Import

This commit is contained in:
Mark McDowall 2022-12-17 20:53:57 -08:00
parent fb76c237bf
commit b8714d80a1
2 changed files with 26 additions and 14 deletions

View File

@ -249,13 +249,19 @@ class ImportSeriesFooter extends Component {
body={ body={
<ul> <ul>
{ {
importError.responseJSON.map((error, index) => { Array.isArray(importError.responseJSON) ?
return ( importError.responseJSON.map((error, index) => {
<li key={index}> return (
{error.errorMessage} <li key={index}>
</li> {error.errorMessage}
); </li>
}) );
}) :
<li>
{
JSON.stringify(importError.responseJSON)
}
</li>
} }
</ul> </ul>
} }

View File

@ -118,13 +118,19 @@ class ImportSeriesSelectFolder extends Component {
<ul> <ul>
{ {
saveError.responseJSON.map((e, index) => { Array.isArray(saveError.responseJSON) ?
return ( saveError.responseJSON.map((e, index) => {
<li key={index}> return (
{e.errorMessage} <li key={index}>
</li> {e.errorMessage}
); </li>
}) );
}) :
<li>
{
JSON.stringify(saveError.responseJSON)
}
</li>
} }
</ul> </ul>
</Alert> : </Alert> :