diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-17 22:45:20 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-17 23:08:07 -0400 |
commit | 87170e14d1260c722c5e534c2e405764153d5946 (patch) | |
tree | edfb585809dfd5f6e48a49ebbf483783a72a2fe4 /src | |
parent | dfd6f5d75aebd7a0a41305831ec6d194ae092f5d (diff) | |
download | gitblit-87170e14d1260c722c5e534c2e405764153d5946.tar.gz gitblit-87170e14d1260c722c5e534c2e405764153d5946.zip |
[findbugs] Add null check when closing a RevWalk in JGitUtils
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/gitblit/utils/JGitUtils.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index 0cee70d5..190872a7 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -2256,8 +2256,10 @@ public class JGitUtils { } } catch (IOException e) { LOGGER.error("Failed to determine canMerge", e); - } finally { - revWalk.release(); + } finally {
+ if (revWalk != null) { + revWalk.release();
+ } } return MergeStatus.NOT_MERGEABLE; } @@ -2347,8 +2349,10 @@ public class JGitUtils { } } catch (IOException e) { LOGGER.error("Failed to merge", e); - } finally { - revWalk.release(); + } finally {
+ if (revWalk != null) { + revWalk.release();
+ } } return new MergeResult(MergeStatus.FAILED, null); } |