diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index ac1141b8613e514b91caf498d0312c6cede060ee..0120ad8e05826868b7e00a5f53e9522174fa154f 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -38,7 +38,7 @@ class Projects::BlobController < Projects::ApplicationController
   end
 
   def update
-    unless params[:file_name].empty?
+    unless params[:file_name].nil? || params[:file_name].empty?
       @previous_path = @path
       @path = params[:file_name]
       @commit_params[:file_path] = @path