fix nullpointerexception

This commit is contained in:
Sebastian Sdorra
2011-04-30 13:12:23 +02:00
parent 19e10dc359
commit 71824840fd

View File

@@ -319,13 +319,18 @@ public class WindowsHgInstaller extends AbstractHgInstaller
private File getMercurialDirectory(String hgBinary)
{
File directory = null;
File hg = new File(hgBinary);
if (hg.exists() && hg.isFile())
if ( Util.isNotEmpty(hgBinary) )
{
directory = hg.getParentFile();
File hg = new File(hgBinary);
if (hg.exists() && hg.isFile())
{
directory = hg.getParentFile();
}
}
else
if ( directory == null )
{
directory = getMercurialDirectoryFromRegistry();
}