patrickrst / LUCA

LEGO Universe Creation (Lab) Archiver
GNU General Public License v3.0
1 stars 2 forks source link

IndexError: list index out of range #1

Closed le717 closed 11 years ago

le717 commented 11 years ago

Bug

If you enter an invalid username in the field, instead of politely telling you LUCA cannot find the name, it crashes instead, and dumps the following message:

Enter your Creation Lab username: IAMASPAMMER
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 2
7, in <module>
  File "LUCA.py", line 19, in <module>
IndexError: list index out of range

The thing is, line 19 is blank, and the next area it could break would be line 20.

Also, some clarification is needed on the "The username your enter does not match with the one online." message, and while I tried to do that on my forked repo, I can't do too much more to the program at all until I can get the prerequisites working and run it.

le717 commented 11 years ago

More details on this error:

It seems to come up when the username entered (localUserName) only partially matches the one online (onlineUserName). So, if I enter le71, this error is thrown, but if I enter it correctly le717, it downloads. Also, it also seems to come up if the input is not the same case as the online one (Le717). I was wrong about that.

patrickrst commented 11 years ago

Thanks for pointing this out, I understand the problem now, but I wouldn't have been aware if you didn't told me. I will fix this ASAP. (I will also make it so entering the username in lowercase or uppercase letters give the same result, so entering (Le717) would download the same files as (le717) and vice-versa.)

patrickrst commented 11 years ago

Fixed in commit abca12f. Simply had to check if the list is empty, which in that case means LUCA did not found any creations when searching on the Creation Lab for the username entered.