avoid null exception in AzureBlobStorageProvider.GetStoragePath, fixes #4402

This commit is contained in:
Kegan Maher
2015-04-24 15:06:01 -07:00
committed by Sebastien Ros
parent 255547288b
commit dbe89d0a82
2 changed files with 2 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ namespace Orchard.Azure.Services.FileSystems {
_publicHostName = publicHostName;
}
private void EnsureInitialized() {
protected void EnsureInitialized() {
if (_storageAccount != null) {
return;
}

View File

@@ -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));
}