include fallback for missing state file

This commit is contained in:
Brian Gough 2021-01-26 13:59:28 +00:00
parent 8946f87ca6
commit 865e68051e

View file

@ -62,7 +62,7 @@ module.exports = {
'project state file truncated'
)
}
const array = result.toString().split('\n')
const array = result ? result.toString().split('\n') : []
const adjustedLength = Math.max(array.length, 1)
const resourceList = array.slice(0, adjustedLength - 1)
const oldState = array[adjustedLength - 1]