NiceneNerd / BCML

Breath of the Wild Cross-Platform Mod Loader: A mod merger and manager for BOTW
308 stars 57 forks source link

Always skip processing when patch_file is None #510

Open ArchLeaders opened 1 year ago

ArchLeaders commented 1 year ago

Fixes AttributeError: 'NoneType' object has no attribute 'name' when no patch file exists in the root mod directory, but processing still continues because the folder ./patches exists.

Traceback (most recent call last):
  File "c:\users\edgar\appdata\local\programs\python\python38\lib\site-packages\bcml\_api.py", line 33, in status_run
    data = func(*args, **kwargs)
  File "c:\users\edgar\appdata\local\programs\python\python38\lib\site-packages\bcml\_api.py", line 652, in create_bnp
    dev.create_bnp_mod(
  File "c:\users\edgar\appdata\local\programs\python\python38\lib\site-packages\bcml\dev.py", line 374, in create_bnp_mod
    _package_code(tmp_dir, meta)
  File "c:\users\edgar\appdata\local\programs\python\python38\lib\site-packages\bcml\dev.py", line 53, in _package_code
    shutil.move(patch_file, tmp_dir / "patches" / patch_file.name)
AttributeError: 'NoneType' object has no attribute 'name'