gabrielecabrini / EconomyPlus

Minecraft plugin (Economy) for 1.8 to 1.18
https://www.spigotmc.org/resources/economyplus.92975/
GNU General Public License v3.0
10 stars 14 forks source link

Able to send NaN money #24

Closed Lmaxplay closed 2 years ago

Lmaxplay commented 2 years ago

Describe the bug No check to see if value is NaN in Pay.java (this works for Infinity or NegativeInfinity too) Could be an issue in the future

To Reproduce Steps to reproduce the behavior:

  1. Do /pay NaN
  2. Doesn't detect that the input is invalid, and says that you don't have enough money

Expected behavior It should detect that it detects that NaN and Infinity aren't valid inputs, but it doesn't

Screenshots Not applicable

Additional context


        if(Double.isNaN(money) || Double.isInfinite(money)) {
            p.sendMessage(plugin.getMessage("InvalidArgs.Pay"));
            Utils.playErrorSound(p);
            return true;
        }

can be fixed with the above code

gabrielecabrini commented 2 years ago

can you make a pull request for this?

Lmaxplay commented 2 years ago

I am unable too, since it just gives me an error with git. (I am not authorized)

Lmaxplay commented 2 years ago

Also I should be able to now, lemme make a pull request.

Lmaxplay commented 2 years ago

I think its my editor

21:22:44.395: [EconomyPlus] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/fix-nan:refs/heads/fix-nan --set-upstream
remote: Permission to ItsWagPvP/EconomyPlus.git denied to Lmaxplay.
fatal: unable to access 'https://github.com/ItsWagPvP/EconomyPlus/': The requested URL returned error: 403
21:23:23.808: [EconomyPlus] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/fix-nan:refs/heads/fix-nan --set-upstream
remote: Permission to ItsWagPvP/EconomyPlus.git denied to Lmaxplay.
fatal: unable to access 'https://github.com/ItsWagPvP/EconomyPlus/': The requested URL returned error: 403
21:23:26.138: [EconomyPlus] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/fix-nan:refs/heads/fix-nan --set-upstream
remote: Permission to ItsWagPvP/EconomyPlus.git denied to Lmaxplay.
fatal: unable to access 'https://github.com/ItsWagPvP/EconomyPlus/': The requested URL returned error: 403
Lmaxplay commented 2 years ago

I can do it manually, anyways the pull-request is made

Lmaxplay commented 2 years ago

@ItsWagPvP I have made the pull request already, are you ready to merge it?