Fixed missing check for no project file

This commit is contained in:
Salvador E. Tropea 2022-03-13 16:36:15 -03:00
parent 0413699607
commit 4359a538cd
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ class Any_PCB_PrintOptions(VariantOptions):
@staticmethod
def _copy_project(fname):
pro_name = GS.pro_file
if not os.path.isfile(pro_name):
if pro_name is None or not os.path.isfile(pro_name):
return None
pro_copy = fname.replace('.kicad_pcb', GS.pro_ext)
logger.debug('Copying project `{}` to `{}`'.format(pro_name, pro_copy))

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 Salvador E. Tropea
# Copyright (c) 2020-2021 Instituto Nacional de Tecnología Industrial
# Copyright (c) 2020-2022 Salvador E. Tropea
# Copyright (c) 2020-2022 Instituto Nacional de Tecnología Industrial
# License: GPL-3.0
# Project: KiBot (formerly KiPlot)
import os
@ -21,7 +21,7 @@ def copy_project(sch_dir):
ext = GS.pro_ext
source = GS.pro_file
prj_file = os.path.join(sch_dir, GS.sch_basename+ext)
if os.path.isfile(source):
if source is not None and os.path.isfile(source):
copy2(source, prj_file)
else:
# Create a dummy project file to avoid warnings