James Moger
2014-04-17 87170e14d1260c722c5e534c2e405764153d5946
[findbugs] Add null check when closing a RevWalk in JGitUtils
1 files modified
12 ■■■■■ changed files
src/main/java/com/gitblit/utils/JGitUtils.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/utils/JGitUtils.java
@@ -2256,8 +2256,10 @@
            }
        } 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 @@
            }
        } catch (IOException e) {
            LOGGER.error("Failed to merge", e);
        } finally {
            revWalk.release();
        } finally {
            if (revWalk != null) {
                revWalk.release();
            }
        }
        return new MergeResult(MergeStatus.FAILED, null);
    }