Skip to content

Commit

Permalink
Fix NPE seen when trying to verify TISTUD-1517
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Apr 18, 2012
1 parent 61d1ede commit 01adb66
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.radrails.rails.internal;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
Expand All @@ -17,6 +18,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
Expand Down Expand Up @@ -186,7 +188,21 @@ public int getPort()

public URI getDocumentRoot()
{
return fProject.getLocation().append("public").toFile().toURI(); //$NON-NLS-1$
if (fProject == null)
{
return null;
}
IPath projectLocation = fProject.getLocation();
if (projectLocation == null)
{
return null;
}
File file = projectLocation.append("public").toFile(); //$NON-NLS-1$
if (file == null)
{
return null;
}
return file.toURI();
}

public URL getBaseURL()
Expand Down

0 comments on commit 01adb66

Please sign in to comment.