mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Check length before access (#7923)
This commit is contained in:
parent
453dac6d00
commit
6572e64144
@ -432,7 +432,11 @@ export default function PartDetail() {
|
||||
.then((response) => {
|
||||
switch (response.status) {
|
||||
case 200:
|
||||
return response.data[response.data.length - 1];
|
||||
if (response.data.length > 0) {
|
||||
return response.data[response.data.length - 1];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user