extract_path fails on nil paths.

This commit is contained in:
bootstraponline
2012-07-03 10:55:42 -06:00
parent 3f45c76f48
commit 32930cee01
+1
View File
@@ -2,6 +2,7 @@ module Precious
module Helpers
# Extract the path string that Gollum::Wiki expects
def extract_path(file_path)
return nil if file_path.nil?
last_slash = file_path.rindex("/")
if last_slash
file_path[0, last_slash]