mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
avoid null exception in AzureBlobStorageProvider.GetStoragePath, fixes #4402
This commit is contained in:

committed by
Sebastien Ros

parent
255547288b
commit
dbe89d0a82
@@ -63,7 +63,7 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
_publicHostName = publicHostName;
|
||||
}
|
||||
|
||||
private void EnsureInitialized() {
|
||||
protected void EnsureInitialized() {
|
||||
if (_storageAccount != null) {
|
||||
return;
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@ namespace Orchard.Azure.Services.FileSystems.Media {
|
||||
/// <param name="url">The public URL of the media.</param>
|
||||
/// <returns>The corresponding local path.</returns>
|
||||
public string GetStoragePath(string url) {
|
||||
EnsureInitialized();
|
||||
if (url.StartsWith(_absoluteRoot)) {
|
||||
return HttpUtility.UrlDecode(url.Substring(Combine(_absoluteRoot, "/").Length));
|
||||
}
|
||||
|
Reference in New Issue
Block a user