summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-04-17 22:18:27 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-17 23:08:07 -0400
commit9ee8b1b793113e74a2fffc1e2aa764279d1c686d (patch)
tree2e5335923859198357da27315773a194b42b3953 /src
parent3e31e26a90b0f90321bc05af07c20c91659d926c (diff)
downloadgitblit-9ee8b1b793113e74a2fffc1e2aa764279d1c686d.tar.gz
gitblit-9ee8b1b793113e74a2fffc1e2aa764279d1c686d.zip
[findbugs] Null checks on closing a repository in ITicketService
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/tickets/ITicketService.java32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/main/java/com/gitblit/tickets/ITicketService.java b/src/main/java/com/gitblit/tickets/ITicketService.java
index 8d922b59..c2f3283e 100644
--- a/src/main/java/com/gitblit/tickets/ITicketService.java
+++ b/src/main/java/com/gitblit/tickets/ITicketService.java
@@ -379,7 +379,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to create label " + label + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return lb;
}
@@ -405,7 +407,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to update label " + label + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}
@@ -444,7 +448,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to rename label " + oldName + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}
@@ -473,7 +479,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to delete label " + label + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}
@@ -579,7 +587,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to create milestone " + milestone + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return ms;
}
@@ -611,7 +621,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to update milestone " + milestone + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}
@@ -659,7 +671,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to rename milestone " + oldName + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}
@@ -690,7 +704,9 @@ public abstract class ITicketService {
} catch (IOException e) {
log.error("failed to delete milestone " + milestone + " in " + repository, e);
} finally {
- db.close();
+ if (db != null) {
+ db.close();
+ }
}
return false;
}