mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-03-09 22:21:00 +01:00
Check for null payload before going on, refs #526
This commit is contained in:
@@ -77,6 +77,8 @@ export class UpdatesChart extends Chart {
|
||||
this.chart.on('draw', (data) => this.draw(data));
|
||||
|
||||
gpm.on('fetched', (response) => {
|
||||
if (!response.payload) { return; }
|
||||
|
||||
let payload = response.payload.grav;
|
||||
let missing = (response.payload.resources.total + (payload.isUpdatable ? 1 : 0)) * 100 / (response.payload.installed + (payload.isUpdatable ? 1 : 0));
|
||||
let updated = 100 - missing;
|
||||
|
||||
@@ -40,7 +40,7 @@ export default class Updates {
|
||||
grav() {
|
||||
let payload = this.payload.grav;
|
||||
|
||||
if (payload.isUpdatable) {
|
||||
if (payload && payload.isUpdatable) {
|
||||
let task = this.task;
|
||||
let bar = '';
|
||||
|
||||
@@ -66,7 +66,9 @@ export default class Updates {
|
||||
}
|
||||
|
||||
resources() {
|
||||
if (!this.payload.resources.total) { return this.maintenance('hide'); }
|
||||
if (!this.payload || !this.payload.resources || !this.payload.resources.total) {
|
||||
return this.maintenance('hide');
|
||||
}
|
||||
|
||||
let map = ['plugins', 'themes'];
|
||||
let singles = ['plugin', 'theme'];
|
||||
|
||||
28
themes/grav/js/admin.min.js
vendored
28
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
56
themes/grav/js/vendor.min.js
vendored
56
themes/grav/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user