Merge pull request #5201 from thekaveman/1.8.x

Fix null exception in AzureBlobStorageProvider.GetStoragePath
This commit is contained in:
Sébastien Ros
2015-04-30 12:32:10 -07:00
2 changed files with 2 additions and 1 deletions
@@ -56,7 +56,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));
}