diff --git a/src/platform/qt/FrameView.cpp b/src/platform/qt/FrameView.cpp index d09e477ba..1f9d4705d 100644 --- a/src/platform/qt/FrameView.cpp +++ b/src/platform/qt/FrameView.cpp @@ -577,6 +577,9 @@ void FrameView::frameCallback(FrameView* viewer, std::shared_ptr lock) { void FrameView::exportFrame() { QString filename = GBAApp::app()->getSaveFileName(this, tr("Export frame"), tr("Portable Network Graphics (*.png)")); + if (filename.isNull()) { + return; + } CoreController::Interrupter interrupter(m_controller); m_framebuffer.save(filename, "PNG"); } diff --git a/src/platform/qt/GIFView.cpp b/src/platform/qt/GIFView.cpp index ced417365..c0b2d3994 100644 --- a/src/platform/qt/GIFView.cpp +++ b/src/platform/qt/GIFView.cpp @@ -86,7 +86,9 @@ void GIFView::stopRecording() { void GIFView::selectFile() { QString filename = GBAApp::app()->getSaveFileName(this, tr("Select output file"), tr("Graphics Interchange Format (*.gif);;WebP ( *.webp);;Animated Portable Network Graphics (*.png *.apng)")); - m_ui.filename->setText(filename); + if (!filename.isNull()) { + m_ui.filename->setText(filename); + } } void GIFView::setFilename(const QString& filename) { diff --git a/src/platform/qt/PaletteView.cpp b/src/platform/qt/PaletteView.cpp index 60b67a90a..7d70c9741 100644 --- a/src/platform/qt/PaletteView.cpp +++ b/src/platform/qt/PaletteView.cpp @@ -136,6 +136,9 @@ void PaletteView::exportPalette(int start, int length) { CoreController::Interrupter interrupter(m_controller); QString filename = GBAApp::app()->getSaveFileName(this, tr("Export palette"), tr("Windows PAL (*.pal);;Adobe Color Table (*.act)")); + if (filename.isNull()) { + return; + } VFile* vf = VFileDevice::open(filename, O_WRONLY | O_CREAT | O_TRUNC); if (!vf) { LOG(QT, ERROR) << tr("Failed to open output palette file: %1").arg(filename);