Invalid ID fix
This commit is contained in:
parent
c39de38500
commit
bba3e355d0
@ -625,12 +625,12 @@ define([
|
|||||||
var root = exp.find([ROOT]);
|
var root = exp.find([ROOT]);
|
||||||
var toClean = [];
|
var toClean = [];
|
||||||
for (var id in fd) {
|
for (var id in fd) {
|
||||||
id = Number(id);
|
if (String(id) !== String(Number(id))) {
|
||||||
if (!id && id !== 0) {
|
|
||||||
debug("Invalid file ID in filesData.", id);
|
debug("Invalid file ID in filesData.", id);
|
||||||
toClean.push(id);
|
toClean.push(id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
id = Number(id);
|
||||||
var el = fd[id];
|
var el = fd[id];
|
||||||
|
|
||||||
// Clean corrupted data
|
// Clean corrupted data
|
||||||
|
|||||||
@ -707,6 +707,7 @@ define([
|
|||||||
if (type === 'expirable') {
|
if (type === 'expirable') {
|
||||||
return function (fileId) {
|
return function (fileId) {
|
||||||
var data = userObject.getFileData(fileId);
|
var data = userObject.getFileData(fileId);
|
||||||
|
if (!data) { return; }
|
||||||
// Don't push duplicates
|
// Don't push duplicates
|
||||||
if (result.indexOf(data.channel) !== -1) { return; }
|
if (result.indexOf(data.channel) !== -1) { return; }
|
||||||
// Return pads owned by someone else or expired by time
|
// Return pads owned by someone else or expired by time
|
||||||
@ -718,6 +719,7 @@ define([
|
|||||||
if (type === 'owned') {
|
if (type === 'owned') {
|
||||||
return function (fileId) {
|
return function (fileId) {
|
||||||
var data = userObject.getFileData(fileId);
|
var data = userObject.getFileData(fileId);
|
||||||
|
if (!data) { return; }
|
||||||
// Don't push duplicates
|
// Don't push duplicates
|
||||||
if (result.indexOf(data.channel) !== -1) { return; }
|
if (result.indexOf(data.channel) !== -1) { return; }
|
||||||
// Return owned pads
|
// Return owned pads
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user