@@ -60,15 +60,14 @@ public string IcoPath
6060 get { return _icoPath ; }
6161 set
6262 {
63- if ( ! string . IsNullOrEmpty ( PluginDirectory ) && ! Path . IsPathRooted ( value ) )
63+ // As a standard this property will handle prepping and converting to absolute local path for icon image processing
64+ if ( ! string . IsNullOrEmpty ( value )
65+ && ! string . IsNullOrEmpty ( PluginDirectory )
66+ && ! Path . IsPathRooted ( value )
67+ && ! value . StartsWith ( "http://" , StringComparison . OrdinalIgnoreCase )
68+ && ! value . StartsWith ( "https://" , StringComparison . OrdinalIgnoreCase ) )
6469 {
65- string absPath = Path . Combine ( value , IcoPath ) ;
66- // Only convert relative paths if its a valid path
67- if ( File . Exists ( absPath ) )
68- {
69- _icoPath = Path . Combine ( value , IcoPath ) ;
70- }
71-
70+ _icoPath = Path . Combine ( PluginDirectory , value ) ;
7271 }
7372 else
7473 {
@@ -146,16 +145,11 @@ public string PluginDirectory
146145 set
147146 {
148147 _pluginDirectory = value ;
149- if ( ! string . IsNullOrEmpty ( IcoPath ) && ! Path . IsPathRooted ( IcoPath ) )
150- {
151- string absPath = Path . Combine ( value , IcoPath ) ;
152- // Only convert relative paths if its a valid path
153- if ( File . Exists ( absPath ) )
154- {
155- IcoPath = absPath ;
156- }
157-
158- }
148+
149+ // When the Result object is returned from the query call, PluginDirectory is not provided until
150+ // UpdatePluginMetadata call is made at PluginManager.cs L196. Once the PluginDirectory becomes available
151+ // we need to update (only if not Uri path) the IcoPath with the full absolute path so the image can be loaded.
152+ IcoPath = _icoPath ;
159153 }
160154 }
161155
0 commit comments