1
0
mirror of https://github.com/elisspace/FxLifeSheet.git synced 2026-08-29 15:44:00 +00:00

Fix crash for table exist

This commit is contained in:
Felix Krause
2022-03-11 13:46:40 +01:00
parent fb3e93be5c
commit fb02036b6c

View File

@@ -53,7 +53,9 @@ class API
raw_keys = raw_data.group_and_count(:key).order_by(:count).reverse.to_a
# Also, manually add the Swarm categories
raw_keys += database[:all_swarm_checkin_categories].to_a.collect { |row| {key: "Swarm #{row[:category]}", count: row[:count]} }
if database.table_exists?(:all_swarm_checkin_categories)
raw_keys += database[:all_swarm_checkin_categories].to_a.collect { |row| {key: "Swarm #{row[:category]}", count: row[:count]} }
end
return raw_keys
end