diff --git a/lib/server/commands/Propfind.js b/lib/server/commands/Propfind.js index 237301f4..6d51e956 100644 --- a/lib/server/commands/Propfind.js +++ b/lib/server/commands/Propfind.js @@ -196,7 +196,7 @@ function default_1(arg, callback) { }); }); resource.size(targetSource, function (e, size) { return process.nextTick(function () { if (!e) - prop.ele('D:getcontentlength').add(size); + prop.ele('D:getcontentlength').add(size === undefined || size === null || size.constructor !== Number ? 0 : size); nbOut(e); }); }); } diff --git a/src/server/commands/Propfind.ts b/src/server/commands/Propfind.ts index eee6b7b1..69d1cc32 100644 --- a/src/server/commands/Propfind.ts +++ b/src/server/commands/Propfind.ts @@ -254,7 +254,7 @@ export default function(arg : MethodCallArgs, callback) })) resource.size(targetSource, (e, size) => process.nextTick(() => { if(!e) - prop.ele('D:getcontentlength').add(size) + prop.ele('D:getcontentlength').add(size === undefined || size === null || size.constructor !== Number ? 0 : size) nbOut(e); })) }