Skip to content

Commit 8162e27

Browse files
Work around empty app strings
1 parent 1657f8c commit 8162e27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/appium_lib/android/helper.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ def start_element(name, attrs = [])
3939

4040
# scoped to: text resource-id content-desc
4141
attributes_values = attributes.values
42-
id_matches = $driver.lazy_load_strings.select do |_key, value|
43-
attributes_values.include? value
42+
strings = $driver.lazy_load_strings
43+
id_matches = []
44+
45+
unless strings.empty?
46+
id_matches = strings.select do |_key, value|
47+
attributes_values.include? value
48+
end
4449
end
4550

4651
string_ids = nil

0 commit comments

Comments
 (0)