Fixed error when filename is empty