mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
fix npe on windows startup
This commit is contained in:
@@ -82,16 +82,24 @@ public class HgPyFix
|
|||||||
*/
|
*/
|
||||||
public static void fixHgPy(SCMContextProvider context, HgConfig config)
|
public static void fixHgPy(SCMContextProvider context, HgConfig config)
|
||||||
{
|
{
|
||||||
String basePath = context.getBaseDirectory().getAbsolutePath();
|
if ((config != null) && config.isValid())
|
||||||
|
|
||||||
String hg = config.getHgBinary();
|
|
||||||
|
|
||||||
if (hg.startsWith(basePath) && hg.endsWith(HG_BAT))
|
|
||||||
{
|
{
|
||||||
File file = new File(hg);
|
String basePath = context.getBaseDirectory().getAbsolutePath();
|
||||||
|
|
||||||
file = new File(file.getParentFile(), HG_PY);
|
String hg = config.getHgBinary();
|
||||||
fixHgPy(file);
|
|
||||||
|
if (hg.startsWith(basePath) && hg.endsWith(HG_BAT))
|
||||||
|
{
|
||||||
|
File file = new File(hg);
|
||||||
|
|
||||||
|
file = new File(file.getParentFile(), HG_PY);
|
||||||
|
fixHgPy(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug(
|
||||||
|
"could not fix hg.py, because the configuration is not valid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user