Skip to content

Commit

Permalink
Do not crash when no PlaybackEngines are found
Browse files Browse the repository at this point in the history
  • Loading branch information
lacostej committed Aug 21, 2017
1 parent 4a096a5 commit 0715f2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/u3d/installation.rb
Expand Up @@ -65,7 +65,7 @@ def packages
return []
end
fpath = File.expand_path('../PlaybackEngines', path)
raise "Unity installation does not seem correct. Couldn't locate PlaybackEngines." unless Dir.exist? fpath
return [] unless Dir.exist? fpath # install without package
Dir.entries(fpath).select { |e| File.directory?(File.join(fpath, e)) && !(e == '.' || e == '..') }
end

Expand Down Expand Up @@ -156,7 +156,7 @@ def packages
# Unity prior to Unity5 did not have package
return [] if Utils.parse_unity_version(version)[0].to_i <= 4
fpath = "#{path}/Editor/Data/PlaybackEngines/"
raise "Unity installation does not seem correct. Couldn't locate PlaybackEngines." unless Dir.exist? fpath
return [] unless Dir.exist? fpath # install without package
Dir.entries(fpath).select { |e| File.directory?(File.join(fpath, e)) && !(e == '.' || e == '..') }
end

Expand Down

0 comments on commit 0715f2a

Please sign in to comment.