Update apply.rb

File.exist? throws an exception if file_name is nil instead of "". 

Use .to_s to normalise file_name to a string rather than have an explicit nil check.