Skip to content

Commit 5b3ee3f

Browse files
committed
adds additional condition to PathUtils#split_subpath to avoid undefined method error for 'start_with?'
1 parent 58cca17 commit 5b3ee3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sprockets/path_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def set_pipeline(path, mime_exts, pipeline_exts, pipeline)
162162
def split_subpath(path, subpath)
163163
return "" if path == subpath
164164
path = File.join(path, ''.freeze)
165-
if subpath.start_with?(path)
165+
if !subpath.nil? && subpath.start_with?(path)
166166
subpath[path.length..-1]
167167
else
168168
nil

0 commit comments

Comments
 (0)