gui: Check data before calling .reverse() (#5793)

This commit is contained in:
Simon Frei 2019-06-14 13:14:15 +02:00 committed by Jakob Borg
parent abd363e8bb
commit 6b1d7ac727

View File

@ -726,6 +726,11 @@ angular.module('syncthing.core')
var refreshGlobalChanges = debounce(function () {
$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();
$scope.globalChangeEvents = data;
console.log("refreshGlobalChanges", data);