Fix for when the dbMetadata table exists, but there is no patch level yet
This shouldn't happen really, but deal with it in case it does.
This commit is contained in:
Родитель
b5c8cdced1
Коммит
19e21b103c
11
index.js
11
index.js
|
@ -131,8 +131,15 @@ function readDbPatchLevel(callback) {
|
|||
function(err, result) {
|
||||
if (err) { return callback(err) }
|
||||
|
||||
// convert the patch level from a string to a number
|
||||
ctx.currentPatchLevel = +result[0].value
|
||||
if ( result.length === 0 ) {
|
||||
// nothing in the table yet
|
||||
ctx.currentPatchLevel = 0
|
||||
}
|
||||
else {
|
||||
// convert the patch level from a string to a number
|
||||
ctx.currentPatchLevel = +result[0].value
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче