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:
Gary Spencer
2008-09-30 15:23:37 +00:00
parent a7aa0d92f5
commit 1ba9b17909

View File

@@ -71,34 +71,41 @@ public class PseudoFileImpl implements PseudoFileInterface
String[] paths = FileName.splitPath( path); String[] paths = FileName.splitPath( path);
FileState fstate = getStateForPath( ctx, paths[0]); FileState fstate = getStateForPath( ctx, paths[0]);
if ( fstate != null && fstate.hasPseudoFiles()) // Check if there is a file name from the path splitting
{
// Check if there is a matching pseudo file if ( paths[1] != null) {
PseudoFile pfile = fstate.getPseudoFileList().findFile( paths[1], false); // Check the pseudo file list, if available
if ( pfile != null)
isPseudo = true;
}
else
{
// Check if the file name matches a pseudo-file name in the desktop actions list
if ( ctx.hasDesktopActions()) if ( fstate != null && fstate.hasPseudoFiles())
{ {
DesktopActionTable actions = ctx.getDesktopActions(); // Check if there is a matching pseudo file
if ( actions.getActionViaPseudoName( paths[1]) != null)
isPseudo = true; PseudoFile pfile = fstate.getPseudoFileList().findFile( paths[1], false);
} if ( pfile != null)
isPseudo = true;
// Check if the URL file is enabled }
else
if ( isPseudo == false && ctx.hasURLFile()) {
{ // Check if the file name matches a pseudo-file name in the desktop actions list
// Check if it is the URL file name
if ( ctx.hasDesktopActions())
if ( ctx.getURLFileName().equals( paths[1])) {
isPseudo = true; 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 // Return the pseudo file status