-
Notifications
You must be signed in to change notification settings - Fork 234
Division by zero #1147
Comments
It's a simple check to see if |
I think is better if we do the check when the bot loads the list and removes all the fully evolved pokemon from it.. |
Good idea, didn't quite read through and understand your steps to reproduce. |
This isnt possible currently @gise88 , or so I believe, as you cant delete anything from the settings object. Furthermore, if there will be new pokemon later on, it would be wise just to add a check if the pokemon can be evolved |
Oh, ok! Than, what @muschter has said is the our best option! 😃 |
I can rewrite you the function however I can not test it. |
Ok, no problem! If you prefer I can clone your own repo and test it.. =) |
I'll tell you when Im ready. I am not sure it will be today as some guests are coming over soon |
EvolvePokemon.kt.zip I can not push this into the develop branch as there is an open PR. If its too difficult I can however create a new branch, just tell me |
I was trying it when i get my account banned! 😢 Tomorrow i will try with a new account... Sorry for this late.. |
@gise88 I have submitted a pull request to fix this issue. |
@muschter ok you fixed it the other way but should work too :) |
* Use correct altitude * Rebase (#1) * Updated explanation in several files (#1152) * Updated some of the readme files (API/FAQ/USAGE and ISSUE TEMPLATE) * Additional information * Fixed some words with feedback from jabbink * Lowercase "ptc", to be sure ^-^ * Some more clarification * Fix #1147 (#1157) * Ensure template correctness (#1154) * fixed typo in template file * wrote tests for json-template * fixed json-template with help from the new TestSettings * Separated json credential testing from properties testing * Use correct altitude(and cache it) * Rebase (#2) * Updated explanation in several files (#1152) * Updated some of the readme files (API/FAQ/USAGE and ISSUE TEMPLATE) * Additional information * Fixed some words with feedback from jabbink * Lowercase "ptc", to be sure ^-^ * Some more clarification * Fix #1147 (#1157) * Ensure template correctness (#1154) * fixed typo in template file * wrote tests for json-template * fixed json-template with help from the new TestSettings * Separated json credential testing from properties testing * Cleaner string concatenation * Use Google API first(without API key), when it hits the rate limit, use mapzen * More try block coverage * Added logging if requests fail, removed unused import * More detailed log message
Description:
If you enter a fully evolved pokemon inside the "evolve_before_transfer" list, the variable
pokemonMeta.candyToEvolve
(https://github.com/jabbink/PokemonGoBot/blob/develop/src/main/kotlin/ink/abb/pogo/scraper/tasks/EvolvePokemon.kt#L32) will be zero..I know, this is a user error but seems easy to prevent..
Steps to reproduce:
Add a latest evolution of a pokemon inside the "evolve_before_transfer" list
Expected behavior:
Warn and ignore fully evolved pokemon
Actual behavior:
Stacktrace (If it's a crash):
17 ago 18:07:43 [default: ProfileLoop] - Error running loop ProfileLoop!
java.lang.ArithmeticException: / by zero
at ink.abb.pogo.scraper.tasks.EvolvePokemon.run(EvolvePokemon.kt:32)
at ink.abb.pogo.scraper.Bot.task(Bot.kt:262)
at ink.abb.pogo.scraper.Bot$start$3.invoke(Bot.kt:144)
at ink.abb.pogo.scraper.Bot$start$3.invoke(Bot.kt:36)
at ink.abb.pogo.scraper.Bot$runLoop$1.invoke(Bot.kt:204)
at ink.abb.pogo.scraper.Bot$runLoop$1.invoke(Bot.kt:36)
at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18)
Version:
f9c163e
Operating System:
Debian 8
Java version:
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Leave this sentence in your issue as proof that you have read and used this template.
The text was updated successfully, but these errors were encountered: