Bug 515341 - NPE occurred while installing an auto-refresh monitor

Change-Id: I32fc7b2f78274980468a95375c4dbd32951322dc
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
index a9909ab..26bf4aa 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/refresh/win32/Win32Monitor.java
@@ -197,7 +197,10 @@
 		}
 
 		protected void openHandleOn(IResource resource) {
-			openHandleOn(resource.getLocation().toOSString(), true);
+			IPath location = resource.getLocation();
+			if (location != null) {
+				openHandleOn(location.toOSString(), true);
+			}
 		}
 
 		private void openHandleOn(String path, boolean subtree) {