Skip to content

Commit

Permalink
fix: TypeError when launching for the first time.
Browse files Browse the repository at this point in the history
TypeError: expected str, bytes or os.PathLike object, not NoneType
  • Loading branch information
Linbreux committed Jul 11, 2024
1 parent 707fb09 commit 5b9f410
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wikmd/plugins/draw/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def create_draw_file(self, filename: str) -> None:
"""
Copy the default drawing to a new one with this filename
"""

if self.drawings_folder == None:
self.flask_app.logger.warning(f"DrawIO folder does not exist yet. Trying to create it now.")
self.post_setup()

path_to_file = os.path.join(self.drawings_folder, filename)
shutil.copyfile(os.path.join(self.this_location, "default_draw"), path_to_file)
s = open(path_to_file,"r")
Expand Down

0 comments on commit 5b9f410

Please sign in to comment.