Skip to content

Commit

Permalink
add condition check for error msg
Browse files Browse the repository at this point in the history
Signed-off-by: Xichen Pan <xichen.pan@gmail.com>
  • Loading branch information
xichen1 committed Feb 24, 2024
1 parent 4a70373 commit 4116710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dashboard/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const errorHandler = error => {
const errortext = (
<>
{codeMessage[response.status] || response.statusText} <br />
{data.msg[0]}
{data && data.msg && Array.isArray(data.msg) && data.msg.length > 0 && data.msg[0]}
</>
);
const { status, url } = response;
Expand Down

0 comments on commit 4116710

Please sign in to comment.