davidteather / BackpackTf-API

Unoffical Backpack.tf wrapper in python
https://davidteather.github.io/BackpackTf-API/
MIT License
14 stars 7 forks source link

itemPrice library error when API key is not valid #9

Closed nbordin closed 4 years ago

nbordin commented 4 years ago

The result should be verified when calling item_price: the variable success is not defined in the case when jsondata['response']['success'] != 1.

Traceback:

price = api.itemPrice(name="Digit Divulger", quality="Unique", craftable=1, tradable=1)
  File "/home/a/.local/share/virtualenvs/steam-49pLg0Sz/lib/python3.7/site-packages/BackpackTF/currency.py", line 118, in item_price
    if success:
UnboundLocalError: local variable 'success' referenced before assignment

@davidteather

See: https://github.com/nbordin/BackpackTf-API/blob/master/BackpackTF/currency.py

davidteather commented 4 years ago

Fixed