From 6dee1e99c3dbd199e50b1184f0170c43c0333b39 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 23 Oct 2019 11:02:34 +0800 Subject: [PATCH] fix: calling DGioVolume::getMount() on an unmounted volume results in a crash. --- gio-qt/source/dgiovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio-qt/source/dgiovolume.cpp b/gio-qt/source/dgiovolume.cpp index d4a34d8..23890c1 100644 --- a/gio-qt/source/dgiovolume.cpp +++ b/gio-qt/source/dgiovolume.cpp @@ -129,7 +129,7 @@ QExplicitlySharedDataPointer DGioVolume::getMount() Q_D(DGioVolume); Glib::RefPtr mnt = d->getGmmVolumeInstance()->get_mount(); - QExplicitlySharedDataPointer mntPtr(new DGioMount(mnt.release())); + QExplicitlySharedDataPointer mntPtr(mnt ? new DGioMount(mnt.release()) : nullptr); return mntPtr; }