# HG changeset patch # User Dmitry Neverov # Date 1499856108 -7200 # Node ID 81dc5c6fdb2550a874bd041caa44ee5a4b3dcf2b # Parent 1f9c8d7f3a121dcf66d3e03da28c9af7ab8db368# Parent 0a31f12174ca6b9169cb5cbf703b49cfe26d1549 Merge branch Indore-2017.1.x diff -r 1f9c8d7f3a12 -r 81dc5c6fdb25 mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialUrlSupport.java --- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialUrlSupport.java Thu Jun 22 12:55:21 2017 +0200 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialUrlSupport.java Wed Jul 12 12:41:48 2017 +0200 @@ -97,9 +97,10 @@ } HttpClient client = HttpUtil.createHttpClient(30); - GetMethod get = new GetMethod(capabilitiesUrl); + GetMethod get = null; try { + get = new GetMethod(capabilitiesUrl); if (credentials != null) { URL url = new URL(fetchUrl); HttpState state = new HttpState(); @@ -129,7 +130,8 @@ } catch (Exception e) { Loggers.VCS.debug("Got error while sending HTTP request to " + capabilitiesUrl, e); } finally { - get.releaseConnection(); + if (get != null) + get.releaseConnection(); } return false;