fix: Error when deleting last travel entry.
This commit is contained in:
@@ -97,6 +97,9 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||||||
})
|
})
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
if (!Array.isArray(data)) {
|
||||||
|
data = [];
|
||||||
|
}
|
||||||
let totalDistanceHomework = 0;
|
let totalDistanceHomework = 0;
|
||||||
let totalDistanceBusiness = 0;
|
let totalDistanceBusiness = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user