lib/u3d/unity_project.rb in u3d-1.0.10 vs lib/u3d/unity_project.rb in u3d-1.0.11

- old
+ new

@@ -34,10 +34,12 @@ Dir.exist?("#{@path}/Assets") && Dir.exist?("#{@path}/ProjectSettings") end def editor_version require 'yaml' - yaml = YAML.safe_load(File.read("#{@path}/ProjectSettings/ProjectVersion.txt")) + project_version = "#{@path}/ProjectSettings/ProjectVersion.txt" + return nil unless File.exist? project_version + yaml = YAML.safe_load(File.read(project_version)) version = yaml['m_EditorVersion'] version.gsub!(/(\d+\.\d+\.\d+)(?:x)?(\w\d+)(?:Linux)?/, '\1\2') if Helper.linux? version end end