Pārlūkot izejas kodu

Better error message when trying to upload a file to virtual S3 root "folder".

Source commit: f761c7b13783927d18b2a77cc5985c56adbbc2bb
Martin Prikryl 7 gadi atpakaļ
vecāks
revīzija
f58232905e
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      source/core/S3FileSystem.cpp

+ 5 - 0
source/core/S3FileSystem.cpp

@@ -1312,6 +1312,11 @@ void __fastcall TS3FileSystem::Source(
   UnicodeString BucketName, Key;
   ParsePath(DestFullName, BucketName, Key);
 
+  if (Key.IsEmpty())
+  {
+    throw Exception(LoadStr(MISSING_TARGET_BUCKET));
+  }
+
   TLibS3BucketContext BucketContext = GetBucketContext(BucketName);
 
   UTF8String ContentType = UTF8String(FTerminal->Configuration->GetFileMimeType(Handle.FileName));