Prechádzať zdrojové kódy

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

Source commit: f761c7b13783927d18b2a77cc5985c56adbbc2bb
Martin Prikryl 7 rokov pred
rodič
commit
f58232905e
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  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));