Invalid ID fix

pull/1/head
yflory 6 years ago
parent c39de38500
commit bba3e355d0

@ -625,12 +625,12 @@ define([
var root = exp.find([ROOT]);
var toClean = [];
for (var id in fd) {
id = Number(id);
if (!id && id !== 0) {
if (String(id) !== String(Number(id))) {
debug("Invalid file ID in filesData.", id);
toClean.push(id);
continue;
}
id = Number(id);
var el = fd[id];
// Clean corrupted data

@ -707,6 +707,7 @@ define([
if (type === 'expirable') {
return function (fileId) {
var data = userObject.getFileData(fileId);
if (!data) { return; }
// Don't push duplicates
if (result.indexOf(data.channel) !== -1) { return; }
// Return pads owned by someone else or expired by time
@ -718,6 +719,7 @@ define([
if (type === 'owned') {
return function (fileId) {
var data = userObject.getFileData(fileId);
if (!data) { return; }
// Don't push duplicates
if (result.indexOf(data.channel) !== -1) { return; }
// Return owned pads

Loading…
Cancel
Save