TShellTreeView: return empty string in GetPathFromNode if Node is nil (Compatible with Delphi's TShellTreeView.GetPath).

git-svn-id: trunk@48167 -
This commit is contained in:
bart 2015-03-08 10:54:40 +00:00
parent 48e9a6c09a
commit d305767d2e

View File

@ -928,15 +928,16 @@ end;
function TCustomShellTreeView.GetPathFromNode(ANode: TTreeNode): string;
begin
Result := '';
if ANode <> nil then // Will return the root if nothing is selected (ANode=nil)
if Assigned(ANode) then
begin
Result := TShellTreeNode(ANode).FullFilename;
if TShellTreeNode(ANode).IsDirectory then
Result := AppendPathDelim(Result);
end;
if not FilenameIsAbsolute(Result) then
Result := GetRootPath() + Result; // Include root directory
if not FilenameIsAbsolute(Result) then
Result := GetRootPath() + Result; // Include root directory
end
else
Result := '';
end;
function TCustomShellTreeView.GetSelectedNodePath: string;