Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #102 from binarious/fix/nil-pointer
Browse files Browse the repository at this point in the history
fix: check if static_file_r_path is set
  • Loading branch information
kurtsson authored Dec 3, 2018
2 parents cc269a9 + d02b428 commit 38f8860
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/jekyll-multiple-languages-plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ module Jekyll
static_files.delete_if do |static_file|

# Remove "/" from beginning of static file relative path
static_file_r_path = static_file.instance_variable_get(:@relative_path).dup
static_file_r_path[0] = ''

exclude_paths.any? do |exclude_path|
Pathname.new(static_file_r_path).descend do |static_file_path|
break(true) if (Pathname.new(exclude_path) <=> static_file_path) == 0
if static_file.instance_variable_get(:@relative_path) != nil
static_file_r_path = static_file.instance_variable_get(:@relative_path).dup
if static_file_r_path
static_file_r_path[0] = ''

exclude_paths.any? do |exclude_path|
Pathname.new(static_file_r_path).descend do |static_file_path|
break(true) if (Pathname.new(exclude_path) <=> static_file_path) == 0
end
end
end
end
end
Expand Down

0 comments on commit 38f8860

Please sign in to comment.