Merge pull request #1125 from Ryex/fix/link-crash-1118

This commit is contained in:
Tayou 2023-06-07 16:14:53 +02:00 committed by GitHub
commit 51ed39804f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ void InstanceCopyTask::copyFinished()
QByteArray allowed_symlinks; QByteArray allowed_symlinks;
if (allowed_symlinks_file.exists()) { if (allowed_symlinks_file.exists()) {
allowed_symlinks.append(FS::read(allowed_symlinks_file.path())); allowed_symlinks.append(FS::read(allowed_symlinks_file.filePath()));
if (allowed_symlinks.right(1) != "\n") if (allowed_symlinks.right(1) != "\n")
allowed_symlinks.append("\n"); // we want to be on a new line allowed_symlinks.append("\n"); // we want to be on a new line
} }
@ -157,9 +157,9 @@ void InstanceCopyTask::copyFinished()
allowed_symlinks.append("\n"); allowed_symlinks.append("\n");
if (allowed_symlinks_file.isSymLink()) if (allowed_symlinks_file.isSymLink())
FS::deletePath(allowed_symlinks_file FS::deletePath(allowed_symlinks_file
.path()); // we dont want to modify the original. also make sure the resulting file is not itself a link. .filePath()); // we dont want to modify the original. also make sure the resulting file is not itself a link.
FS::write(allowed_symlinks_file.path(), allowed_symlinks); FS::write(allowed_symlinks_file.filePath(), allowed_symlinks);
} }
emitSucceeded(); emitSucceeded();