Null check added for empty file name.