mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added a null pointer check after splitting the relative path when checking if the path is to a pseudo file/desktop action. ETHREEOH-217.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11102 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -71,34 +71,41 @@ public class PseudoFileImpl implements PseudoFileInterface
|
||||
String[] paths = FileName.splitPath( path);
|
||||
FileState fstate = getStateForPath( ctx, paths[0]);
|
||||
|
||||
if ( fstate != null && fstate.hasPseudoFiles())
|
||||
{
|
||||
// Check if there is a matching pseudo file
|
||||
// Check if there is a file name from the path splitting
|
||||
|
||||
PseudoFile pfile = fstate.getPseudoFileList().findFile( paths[1], false);
|
||||
if ( pfile != null)
|
||||
isPseudo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if the file name matches a pseudo-file name in the desktop actions list
|
||||
if ( paths[1] != null) {
|
||||
|
||||
if ( ctx.hasDesktopActions())
|
||||
{
|
||||
DesktopActionTable actions = ctx.getDesktopActions();
|
||||
if ( actions.getActionViaPseudoName( paths[1]) != null)
|
||||
isPseudo = true;
|
||||
}
|
||||
// Check the pseudo file list, if available
|
||||
|
||||
// Check if the URL file is enabled
|
||||
if ( fstate != null && fstate.hasPseudoFiles())
|
||||
{
|
||||
// Check if there is a matching pseudo file
|
||||
|
||||
if ( isPseudo == false && ctx.hasURLFile())
|
||||
{
|
||||
// Check if it is the URL file name
|
||||
PseudoFile pfile = fstate.getPseudoFileList().findFile( paths[1], false);
|
||||
if ( pfile != null)
|
||||
isPseudo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if the file name matches a pseudo-file name in the desktop actions list
|
||||
|
||||
if ( ctx.getURLFileName().equals( paths[1]))
|
||||
isPseudo = true;
|
||||
}
|
||||
if ( ctx.hasDesktopActions())
|
||||
{
|
||||
DesktopActionTable actions = ctx.getDesktopActions();
|
||||
if ( actions.getActionViaPseudoName( paths[1]) != null)
|
||||
isPseudo = true;
|
||||
}
|
||||
|
||||
// Check if the URL file is enabled
|
||||
|
||||
if ( isPseudo == false && ctx.hasURLFile())
|
||||
{
|
||||
// Check if it is the URL file name
|
||||
|
||||
if ( ctx.getURLFileName().equals( paths[1]))
|
||||
isPseudo = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return the pseudo file status
|
||||
|
Reference in New Issue
Block a user