Skip to content

Commit

Permalink
adds additional condition to PathUtils#split_subpath to avoid undefin…
Browse files Browse the repository at this point in the history
…ed method error for 'start_with?'
  • Loading branch information
ddink committed Mar 31, 2022
1 parent 58cca17 commit dad2733
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sprockets/path_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def set_pipeline(path, mime_exts, pipeline_exts, pipeline)
def split_subpath(path, subpath)
return "" if path == subpath
path = File.join(path, ''.freeze)
if subpath.start_with?(path)
if !subpath.nil? && subpath.start_with?(path)
subpath[path.length..-1]
else
nil
Expand Down

0 comments on commit dad2733

Please sign in to comment.