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