Check added to prevent crash (out of memory) with zero-sized files