From 7e85c526ff1d127728f11425c296de6309ccc3b9 Mon Sep 17 00:00:00 2001 From: Joel Knight Date: Sat, 26 Feb 2022 14:43:56 -0700 Subject: [PATCH] fix: catch 'no such image' errors from imagePathFunc By fixing the white space of the condition, it will apply to the case where a custom imagePathFunc was provided and where the default function is used. --- md2notion/upload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/md2notion/upload.py b/md2notion/upload.py index 281b602..9428bdd 100644 --- a/md2notion/upload.py +++ b/md2notion/upload.py @@ -83,9 +83,9 @@ def uploadBlock(blockDescriptor, blockParent, mdFilePath, imagePathFunc=None): imgSrc = imagePathFunc(imgRelSrc, mdFilePath) else: imgSrc = relativePathForMarkdownUrl(imgRelSrc, mdFilePath) - if not imgSrc: - print(f"ERROR: Local image '{imgRelSrc}' not found to upload. Skipping...") - return + if not imgSrc: + print(f"ERROR: Local image '{imgRelSrc}' not found to upload. Skipping...") + return print(f"Uploading file '{imgSrc}'") newBlock.upload_file(str(imgSrc))