File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,13 +9,19 @@ class FavoritesAPI {
99 VIDEO_PATH : string ;
1010 HOMEDIR_PATH : string ;
1111 async build ( ) : Promise < void > {
12- this . DOCUMENT_PATH = await path . documentDir ( ) ;
13- this . DOWNLOAD_PATH = await path . downloadDir ( ) ;
14- this . DESKTOP_PATH = await path . desktopDir ( ) ;
15- this . PICTURE_PATH = await path . pictureDir ( ) ;
16- this . MUSIC_PATH = await path . audioDir ( ) ;
17- this . VIDEO_PATH = await path . videoDir ( ) ;
18- this . HOMEDIR_PATH = await path . homeDir ( ) ;
12+ try {
13+ this . DOCUMENT_PATH = await path . documentDir ( ) ;
14+ this . DOWNLOAD_PATH = await path . downloadDir ( ) ;
15+ this . DESKTOP_PATH = await path . desktopDir ( ) ;
16+ this . PICTURE_PATH = await path . pictureDir ( ) ;
17+ this . MUSIC_PATH = await path . audioDir ( ) ;
18+ this . VIDEO_PATH = await path . videoDir ( ) ;
19+ // eslint-disable-next-line no-empty
20+ } catch ( _ ) { }
21+ try {
22+ this . HOMEDIR_PATH = await path . homeDir ( ) ;
23+ // eslint-disable-next-line no-empty
24+ } catch ( _ ) { }
1925 }
2026}
2127
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ const Favorites = async (): Promise<string> => {
2727 result += `<h1 class="section-title">${ await Translate ( 'Favorites' ) } </h1>` ;
2828 const defaultFavoritesList = ( await defaultFavorites ( ) ) . map ( ( favorite ) => favorite . name ) ;
2929 for ( const favorite of favorites ) {
30+ if ( ! favorite . path ) continue ;
3031 if ( favorite . path === 'xplorer://Home' ) continue ;
3132 const fileData = new FileAPI ( favorite . path ) ;
3233 const exists = await fileData . exists ( ) ;
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const createSidebar = async (): Promise<void> => {
4545 let favoritesElement = '' ;
4646 const defaultFavoritesList = ( await defaultFavorites ( ) ) . map ( ( favorite ) => favorite . name ) ;
4747 for ( const favorite of favorites ) {
48+ if ( ! favorite . path ) continue ;
4849 const exists = await new FileAPI ( favorite . path ) . exists ( ) ;
4950 if ( ! ( await isDefaultFavorite ( favorite . path ) ) && ! favorite . path . startsWith ( 'xplorer://' ) ) {
5051 if ( ! exists ) continue ;
You can’t perform that action at this time.
0 commit comments