Skip to content

Commit 70bbc70

Browse files
committed
Copy shared directory only if it exists
1 parent 401f38d commit 70bbc70

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

Source/UI/PluginInstaller.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,18 +1526,19 @@ int PluginInfoComponent::downloadPlugin(const String& plugin, const String& vers
15261526
std::filesystem::path tempSharedPath = tempDir.getChildFile("shared").getFullPathName().toStdString();
15271527
std::filesystem::path destSharedPath = getSharedDirectory().getFullPathName().toStdString();
15281528

1529-
1530-
const auto copyOptions = std::filesystem::copy_options::overwrite_existing
1531-
| std::filesystem::copy_options::recursive
1532-
| std::filesystem::copy_options::copy_symlinks
1533-
;
1534-
1535-
1536-
try {
1537-
std::filesystem::copy(tempSharedPath, destSharedPath, copyOptions);
1538-
} catch(std::filesystem::filesystem_error& e) {
1539-
LOGE("Could not copy shared files: \"", e.what(), "\"");
1540-
}
1529+
// Copy only if shared files exist
1530+
if(std::filesystem::exists(tempSharedPath))
1531+
{
1532+
const auto copyOptions = std::filesystem::copy_options::overwrite_existing
1533+
| std::filesystem::copy_options::recursive
1534+
| std::filesystem::copy_options::copy_symlinks
1535+
;
1536+
try {
1537+
std::filesystem::copy(tempSharedPath, destSharedPath, copyOptions);
1538+
} catch(std::filesystem::filesystem_error& e) {
1539+
LOGE("Could not copy shared files: \"", e.what(), "\"");
1540+
}
1541+
}
15411542

15421543
tempDir.deleteRecursively();
15431544
pluginFile.deleteFile(); // delete zip after uncompressing

0 commit comments

Comments
 (0)