ECMS-4803: Fix the problem NPE when the size of file is 0