UncertainProd / FnF-Spritesheet-and-XML-Maker

A Friday Night Funkin' mod making helper tool that allows you to generate XML files and spritesheets from induvidual pngs
GNU General Public License v3.0
77 stars 71 forks source link

[CRASH] NoneType object is not subscriptable #17

Open EliteMasterEric opened 2 years ago

EliteMasterEric commented 2 years ago
Traceback (most recent call last):
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngUI.py", line 306, in generate_xml
    statuscode, errmsg = xmlpngengine.make_png_xml(
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngengine.py", line 166, in make_png_xml
    final_img_width, final_img_height, max_heights = calculate_final_size(existing_img_dict, imlist, num_cols, clip, reuse_sprites_level)
  File "D:\Programming\Game Modding\Friday Night Funkin\Spritesheets\FnF-Spritesheet-and-XML-Maker\src\xmlpngengine.py", line 99, in calculate_final_size
    widths.append(box[2] - box[0] + 4)
TypeError: 'NoneType' object is not subscriptable
EliteMasterEric commented 2 years ago

I've determined the cause of the issue. If the frame contains no pixels (as an example, the animation from the Tricky Mod where Expurgation Tricky enters has several empty frames at the start), box will be null.

I'll make a pull request for this myself since it shouldn't be too hard.