From e87b14dc3af78b6a8891370b06422688d65b322e Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Sun, 17 Dec 2023 18:14:25 +0100 Subject: [PATCH] Issue #54: Final bugfix --- Pdf4QtViewer/pdfprogramcontroller.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Pdf4QtViewer/pdfprogramcontroller.cpp b/Pdf4QtViewer/pdfprogramcontroller.cpp index b2bf992..63a881b 100644 --- a/Pdf4QtViewer/pdfprogramcontroller.cpp +++ b/Pdf4QtViewer/pdfprogramcontroller.cpp @@ -2625,6 +2625,11 @@ void PDFProgramController::onActionBookmarkGoToPrevious() void PDFProgramController::onActionBookmarkExport() { + if (!m_pdfDocument) + { + return; + } + QFileInfo fileInfo(m_fileInfo.originalFileName); QString saveFileName = QFileDialog::getSaveFileName(m_mainWindow, tr("Export Bookmarks As"), fileInfo.dir().absoluteFilePath(m_fileInfo.originalFileName).replace(".pdf", ".json"), tr("JSON (*.json);;All files (*.*)")); if (!saveFileName.isEmpty()) @@ -2635,6 +2640,11 @@ void PDFProgramController::onActionBookmarkExport() void PDFProgramController::onActionBookmarkImport() { + if (!m_pdfDocument) + { + return; + } + QFileInfo fileInfo(m_fileInfo.originalFileName); QString fileName = QFileDialog::getOpenFileName(m_mainWindow, tr("Select PDF document"), fileInfo.dir().absolutePath(), tr("JSON (*.json)")); if (!fileName.isEmpty())