Skip to content

Commit

Permalink
Handle missing splines.json
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrockey committed Mar 25, 2019
1 parent b7b5484 commit e735a8b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tgc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ def get_metadata_json(course_directory):
return metadata_json

def get_spline_configuration_json(course_directory):
course_dir = Path(course_directory)
spline_json = None
with (course_dir / 'splines.json').open('r') as f:
spline_json = json.loads(f.read())

return spline_json
try:
course_dir = Path(course_directory)
spline_json = None
with (course_dir / 'splines.json').open('r') as f:
spline_json = json.loads(f.read())

return spline_json
except:
return None

def write_course_json(course_directory, course_json):
course_dir = Path(course_directory)
Expand Down

0 comments on commit e735a8b

Please sign in to comment.