about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 13:40:31 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 13:40:31 -0400
commitc016805af84e8a6d36bddb46fae7604b5ee02357 (patch)
treee1bc3bd8fc29fc06f9c7e6812e00ada032ecd4d5
parent760f97e9795eae0169540b159d3ae7bedaa31c8a (diff)
downloadpokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.tar.gz
pokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.tar.bz2
pokeviewer-c016805af84e8a6d36bddb46fae7604b5ee02357.zip
Actually fixed index page when there's no Pokémon
-rw-r--r--app/controllers/pokeviewer/pokemon_controller.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/pokeviewer/pokemon_controller.rb b/app/controllers/pokeviewer/pokemon_controller.rb index 4b49184..49a743c 100644 --- a/app/controllers/pokeviewer/pokemon_controller.rb +++ b/app/controllers/pokeviewer/pokemon_controller.rb
@@ -21,10 +21,14 @@ module Pokeviewer
21 end 21 end
22 end 22 end
23 23
24 if pokemon.peek and pokemon.peek.first == -1 24 @unaccounted = []
25 @unaccounted = pokemon.next.second 25
26 else 26 begin
27 @unaccounted = [] 27 if pokemon.peek.first == -1
28 @unaccounted = pokemon.next.second
29 end
30 rescue StopIteration
31 # There are no Pokémon, but that's fine.
28 end 32 end
29 33
30 @trainers = Trainer.order(id: :asc).all.map do |trainer| 34 @trainers = Trainer.order(id: :asc).all.map do |trainer|