myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2261] trunk/app/controllers/blobs_controller.rb:


From: noreply
Subject: [myexperiment-hackers] [2261] trunk/app/controllers/blobs_controller.rb: fixed runtime when trying to view a file that you can't see
Date: Wed, 5 Aug 2009 11:22:07 -0400 (EDT)

Revision
2261
Author
dgc
Date
2009-08-05 11:22:07 -0400 (Wed, 05 Aug 2009)

Log Message

fixed runtime when trying to view a file that you can't see

Modified Paths

Diff

Modified: trunk/app/controllers/blobs_controller.rb (2260 => 2261)


--- trunk/app/controllers/blobs_controller.rb	2009-08-04 11:59:20 UTC (rev 2260)
+++ trunk/app/controllers/blobs_controller.rb	2009-08-05 15:22:07 UTC (rev 2261)
@@ -335,16 +335,18 @@
   end
   
   def set_sharing_mode_variables
-    case action_name
-      when "new"
-        @sharing_mode  = 0
-        @updating_mode = 6
-      when "create", "update"
-        @sharing_mode  = params[:sharing][:class_id].to_i if params[:sharing]
-        @updating_mode = params[:updating][:class_id].to_i if params[:updating]
-      when "show", "edit"
-        @sharing_mode  = @blob.contribution.policy.share_mode
-        @updating_mode = @blob.contribution.policy.update_mode
+    if @blob
+      case action_name
+        when "new"
+          @sharing_mode  = 0
+          @updating_mode = 6
+        when "create", "update"
+          @sharing_mode  = params[:sharing][:class_id].to_i if params[:sharing]
+          @updating_mode = params[:updating][:class_id].to_i if params[:updating]
+        when "show", "edit"
+          @sharing_mode  = @blob.contribution.policy.share_mode
+          @updating_mode = @blob.contribution.policy.update_mode
+      end
     end
   end
   

reply via email to

[Prev in Thread] Current Thread [Next in Thread]