瀏覽代碼

fix crash when exporting external file

Le Tan 4 年之前
父節點
當前提交
319da24989
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/export/exporter.cpp

+ 3 - 0
src/export/exporter.cpp

@@ -80,6 +80,9 @@ void Exporter::exportAttachments(Node *p_node,
                                  const QString &p_outputFolder,
                                  const QString &p_outputFolder,
                                  const QString &p_destFilePath)
                                  const QString &p_destFilePath)
 {
 {
+    if (!p_node) {
+        return;
+    }
     const auto &attachmentFolder = p_node->getAttachmentFolder();
     const auto &attachmentFolder = p_node->getAttachmentFolder();
     if (!attachmentFolder.isEmpty()) {
     if (!attachmentFolder.isEmpty()) {
         auto relativePath = PathUtils::relativePath(PathUtils::parentDirPath(p_srcFilePath),
         auto relativePath = PathUtils::relativePath(PathUtils::parentDirPath(p_srcFilePath),