Ignore:
Timestamp:
May 7, 2009, 1:56:24 PM (14 years ago)
Author:
Martin Svensson
Message:

Fixes #1306 File browser fails if wrong project is selected when browsing a directory shared to another project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.11-stable/www/filemanager/directories/list_directories.jsp

    r4796 r4924  
    103103  final Directory userHome = user.getHomeDirectory();
    104104  final boolean readDirectories = sc.hasPermission(Permission.READ, Item.DIRECTORY);
    105   final Directory root = Directory.getById(dc, SystemItems.getId(readDirectories ? Directory.ROOT : Directory.HOME));
    106   Directory current = directoryId != 0 ? Directory.getById(dc, directoryId) : null;
     105  final Directory root = Directory.getById(dc, SystemItems.getId(readDirectories ? Directory.ROOT : Directory.HOME));
     106 
     107  Directory current = null;
     108  // Try to get current/last visited directory. If not successful, use default directory.
     109  try
     110  {
     111    current = directoryId != 0 ? Directory.getById(dc, directoryId) : null;
     112  }
     113  catch (Throwable ex){} 
    107114  if (current == null) current = userHome;
    108115  if (current == null) current = root;
Note: See TracChangeset for help on using the changeset viewer.