mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20397: Exceptions are not used for flow control anymore in some storage services
Work Item: 20397 Signed-off-by: Zoltán Lehóczky <lehoczky_zoltan@pyrocenter.hu>
This commit is contained in:
@@ -23,6 +23,10 @@ namespace Orchard.Azure.Services.FileSystems.Media {
|
||||
|
||||
public bool TrySaveStream(string path, Stream inputStream) {
|
||||
try {
|
||||
if (FileExists(path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SaveStream(path, inputStream);
|
||||
}
|
||||
catch {
|
||||
|
@@ -298,6 +298,10 @@ namespace Orchard.FileSystems.Media {
|
||||
/// <returns>True if success; False otherwise.</returns>
|
||||
public bool TrySaveStream(string path, Stream inputStream) {
|
||||
try {
|
||||
if (FileExists(path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SaveStream(path, inputStream);
|
||||
}
|
||||
catch {
|
||||
|
Reference in New Issue
Block a user