fix: abort rollback if null toVersion

This commit is contained in:
Rhys Arkins 2018-10-19 06:57:21 +02:00
parent 46dfc5eb1d
commit e9053fbe4a

View file

@ -38,6 +38,11 @@ function getRollbackUpdate(config, versions) {
);
lessThanVersions.sort(sortVersions);
const toVersion = lessThanVersions.pop();
// istanbul ignore if
if (!toVersion) {
logger.info('No toVersion to roll back to');
return null;
}
let fromVersion;
const newValue = getNewValue(currentValue, 'replace', fromVersion, toVersion);
return {