Fix crash in update checker if package.json's repository value is set to a repository without releases
parent
dab1154154
commit
d625e527d6
|
@ -60,7 +60,9 @@ async function refreshVersions() {
|
|||
res.on('data', chunk => data += chunk);
|
||||
res.on('end', async () => {
|
||||
const parsed = JSON.parse(data);
|
||||
let latestVersion = parsed[0].name;
|
||||
if (! Array.isArray(parsed) || parsed.length === 0) return;
|
||||
|
||||
const latestVersion = parsed[0].name;
|
||||
await knex('updates').update({
|
||||
available_version: latestVersion,
|
||||
last_checked: moment.utc().format('YYYY-MM-DD HH:mm:ss')
|
||||
|
|
Loading…
Reference in New Issue