Fix missing bounds checks, unsafe JSON.parse, and cleanup issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -174,8 +174,10 @@ export const useFilesStore = defineStore("filesStore", {
|
||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
|
||||
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'
|
||||
const detail = error.response.data.detail;
|
||||
|
||||
uploadFailedFirst(detail[0].type, detail[0].msg, detail[0].loc[2]);
|
||||
if (Array.isArray(detail) && detail.length > 0) {
|
||||
const loc = detail[0].loc;
|
||||
uploadFailedFirst(detail[0].type, detail[0].msg, Array.isArray(loc) && loc.length > 2 ? loc[2] : undefined);
|
||||
}
|
||||
} else {
|
||||
Swal.close(); // Close the loading progress bar
|
||||
apiError(error, "Failed to upload the files.");
|
||||
|
||||
Reference in New Issue
Block a user