Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339553

Summary: [server] Missing null check in GitUtils#getGitDir
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2011-03-10 12:02:59 EST
See:

		IFileStore fileStore = NewFileServlet.getFileStore(p, authority);
		File file = fileStore.toLocalFile(EFS.NONE, null);

getFileStore can return null, but it is not checked. I think it just needs:

if (fileStore == null)
  return null;

Also it would be helpful for the method javadoc to say it can return null (even if this is not API).
Comment 1 Tomasz Zarna CLA 2011-03-14 07:24:59 EDT
Fixed with 3a185c15d207c81f2fc81e1caee5d254c28d98aa.