diff --git a/dali/base/dadfs.cpp b/dali/base/dadfs.cpp index 1ad137e69ef..26973d14f81 100644 --- a/dali/base/dadfs.cpp +++ b/dali/base/dadfs.cpp @@ -3566,23 +3566,33 @@ class CDistributedFile: public CDistributedFileBase offset_t maxPartSz = 0, minPartSz = (offset_t)-1, totalPartSz = 0; - maxSkewPart = 0; - minSkewPart = 0; - for (unsigned p=0; p maxPartSz) - { - maxPartSz = size; - maxSkewPart = p; - } - if (size < minPartSz) + maxSkewPart = 0; + minSkewPart = 0; + for (unsigned p=0; p maxPartSz) + { + maxPartSz = size; + maxSkewPart = p; + } + if (size < minPartSz) + { + minPartSz = size; + minSkewPart = p; + } + totalPartSz += size; } - totalPartSz += size; + } + catch (IException *e) + { + // guard against getFileSize throwing an exception (if parts missing) + EXCLOG(e); + e->Release(); + return false; } offset_t avgPartSz = totalPartSz / np; if (0 == avgPartSz)