gui: Check data before calling .reverse() (#5793)
This commit is contained in:
parent
abd363e8bb
commit
6b1d7ac727
@ -726,6 +726,11 @@ angular.module('syncthing.core')
|
|||||||
|
|
||||||
var refreshGlobalChanges = debounce(function () {
|
var refreshGlobalChanges = debounce(function () {
|
||||||
$http.get(urlbase + "/events/disk?limit=25").success(function (data) {
|
$http.get(urlbase + "/events/disk?limit=25").success(function (data) {
|
||||||
|
if (!data) {
|
||||||
|
// For reasons unknown this is called with data being the empty
|
||||||
|
// string on shutdown, causing an error on .reverse().
|
||||||
|
return;
|
||||||
|
}
|
||||||
data = data.reverse();
|
data = data.reverse();
|
||||||
$scope.globalChangeEvents = data;
|
$scope.globalChangeEvents = data;
|
||||||
console.log("refreshGlobalChanges", data);
|
console.log("refreshGlobalChanges", data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user