From d8263c70574c6cb27329e270aebe3ba231f5e9ce Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 10 Apr 2013 11:45:15 -0400 Subject: resharper suggestions in common implementations --- MediaBrowser.Common.Implementations/BaseApplicationPaths.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Common.Implementations/BaseApplicationPaths.cs') diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index 56e699b35..0bd8b9df8 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.Common.Implementations /// /// Gets the path to the system folder /// - public string ProgramSystemPath { get { return Path.Combine(ProgramDataPath, "System"); }} + public string ProgramSystemPath { get { return Path.Combine(ProgramDataPath, "System"); } } /// /// The _data directory @@ -291,7 +291,7 @@ namespace MediaBrowser.Common.Implementations /// Gets the path to the application's ProgramDataFolder /// /// System.String. - private string GetProgramDataPath() + private string GetProgramDataPath() { var programDataPath = _useDebugPath ? ConfigurationManager.AppSettings["DebugProgramDataPath"] : Path.Combine(ConfigurationManager.AppSettings["ReleaseProgramDataPath"], ConfigurationManager.AppSettings["ProgramDataFolderName"]); @@ -303,11 +303,16 @@ namespace MediaBrowser.Common.Implementations var path = Assembly.GetExecutingAssembly().Location; path = Path.GetDirectoryName(path); + if (string.IsNullOrEmpty(path)) + { + throw new ApplicationException("Unable to determine running assembly location"); + } + programDataPath = Path.Combine(path, programDataPath); programDataPath = Path.GetFullPath(programDataPath); } - + if (!Directory.Exists(programDataPath)) { Directory.CreateDirectory(programDataPath); -- cgit v1.2.3