npcf_builder add exception handling if file could not be read

This commit is contained in:
Alexander Weber 2017-01-18 23:43:16 +01:00
parent d963198801
commit ecd0eeea1e

View File

@ -56,6 +56,11 @@ local function load_schematic(self, filename)
if SCHEMLIB_PATH then
self.schemlib_plan = schemlib.plan.new()
self.schemlib_plan:read_from_schem_file(fullpath)
if not self.schemlib_plan.data then
print("file could not be read")
reset_build(self)
return
end
self.schemlib_plan.anchor_pos = self.metadata.build_pos
self.schemlib_plan:apply_flood_with_air(3, 0, 3)
schemlib.mapping.do_mapping(self.schemlib_plan.data)