lib/calabash/android/environment.rb in calabash-1.9.9.pre1 vs lib/calabash/android/environment.rb in calabash-1.9.9.pre2
- old
+ new
@@ -395,10 +395,16 @@
def self.monodroid_config_file
File.expand_path('~/.config/xbuild/monodroid-config.xml')
end
def self.read_attribute_from_monodroid_config(element, attribute)
- REXML::Document.new(IO.read(monodroid_config_file)).elements["//#{element}"].attributes[attribute]
+ element = REXML::Document.new(IO.read(monodroid_config_file)).elements["//#{element}"]
+
+ if element
+ element.attributes[attribute]
+ else
+ nil
+ end
end
def self.find_executable_on_path(executable)
path_elements.each do |x|
f = File.join(x, executable)