Bug 563050 - No java debug sources due to NPE when accessing
IResource.getLocation() on non standard FileSystem

- getLocation() occasionally returns null for non local filesystems or
in presence of yet not resolved variables.

Change-Id: I8949d77f7d0e380b0532a3ce467c4937143214a5
Signed-off-by: Reguel Wermelinger <reguel.wermelinger@ivyteam.ch>
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/advanced/AdvancedSourceLookup.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/advanced/AdvancedSourceLookup.java
index eefa06c..f0b3fba 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/advanced/AdvancedSourceLookup.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/advanced/AdvancedSourceLookup.java
@@ -93,9 +93,14 @@
 
 	private static void addWorkspaceLocation(Collection<File> locations, IPath workspacePath) {
 		IResource resource = root.findMember(workspacePath);
-		if (resource != null) {
-			locations.add(resource.getLocation().toFile());
+		if (resource == null) {
+			return;
 		}
+		IPath location = resource.getLocation();
+		if (location == null) {
+			return;
+		}
+		locations.add(location.toFile());
 	}
 
 	/**