View | Details | Raw Unified | Return to bug 203490 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java (-9 / +13 lines)
Lines 13-18 Link Here
13
 * Martin Oberhuber (Wind River) - [192724] Fixed logic to filter folders if FILE_TYPE_FOLDERS
13
 * Martin Oberhuber (Wind River) - [192724] Fixed logic to filter folders if FILE_TYPE_FOLDERS
14
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
14
 * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary
15
 * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems
15
 * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems
16
 * Martin Oberhuber (Wind River) - [203490] Fix NPE in SftpService.getUserHome()
16
 *******************************************************************************/
17
 *******************************************************************************/
17
18
18
package org.eclipse.rse.internal.services.ssh.files;
19
package org.eclipse.rse.internal.services.ssh.files;
Lines 574-589 Link Here
574
	
575
	
575
	public IHostFile getUserHome() {
576
	public IHostFile getUserHome() {
576
		//TODO Assert: this is only called after we are connected
577
		//TODO Assert: this is only called after we are connected
577
		int lastSlash = fUserHome.lastIndexOf('/');
578
		if (fUserHome!=null) {
578
		String name = fUserHome.substring(lastSlash + 1);	
579
			int lastSlash = fUserHome.lastIndexOf('/');
579
		String parent = fUserHome.substring(0, lastSlash);
580
			String name = fUserHome.substring(lastSlash + 1);	
580
		try {
581
			String parent = fUserHome.substring(0, lastSlash);
581
			return getFile(parent, name, null);
582
			try {
582
		} catch(SystemMessageException e) {
583
				return getFile(parent, name, null);
583
			//Could not determine user home
584
			} catch(SystemMessageException e) {
584
			//return new SftpHostFile(".",".",true,false,false,0,0); //$NON-NLS-1$ //$NON-NLS-2$
585
				//Error getting user home -> return a default below
585
			return new SftpHostFile("/", "/", true, true, false, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$
586
			}
586
		}
587
		}
588
		//Could not determine user home
589
		//return new SftpHostFile(".",".",true,false,false,0,0); //$NON-NLS-1$ //$NON-NLS-2$
590
		return new SftpHostFile("/", "/", true, true, false, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$
587
	}
591
	}
588
592
589
	public IHostFile[] getRoots(IProgressMonitor monitor) {
593
	public IHostFile[] getRoots(IProgressMonitor monitor) {

Return to bug 203490