Skip to content

Commit

Permalink
Merge pull request #56 from craftcms/bugfix/urlEncodePathSegments-null
Browse files Browse the repository at this point in the history
Only urlEncodePathSegments when path is not null
  • Loading branch information
timkelty authored Oct 9, 2024
2 parents 10feeb6 + 0c1d584 commit ccf2a37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function actionCreateAsset(): Response
$asset->folderId = $folder->id;

// Handle special characters that have been encoded from the presigned URL
$asset->folderPath = Fs::urlEncodePathSegments($folder->path);
$asset->folderPath = is_string($folder->path) ? Fs::urlEncodePathSegments($folder->path) : $asset->folderPath;

if (!$selectionCondition) {
$asset->newFilename = $targetFilename;
Expand Down

0 comments on commit ccf2a37

Please sign in to comment.