mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
Merge pull request #6877 from gdicristofaro/7501-npeOnClose
7501 fix npe on web categories close
This commit is contained in:
commit
f1b5cb72b0
@ -45,7 +45,6 @@ import java.util.stream.Stream;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.openide.modules.InstalledFileLocator;
|
import org.openide.modules.InstalledFileLocator;
|
||||||
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
|
|
||||||
import org.sleuthkit.autopsy.url.analytics.DomainCategory;
|
import org.sleuthkit.autopsy.url.analytics.DomainCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -396,7 +395,7 @@ class WebCategoriesDataModel implements AutoCloseable {
|
|||||||
* @return The list of domain suffixes and their categories.
|
* @return The list of domain suffixes and their categories.
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
List<DomainCategory> getRecords() throws SQLException {
|
synchronized List<DomainCategory> getRecords() throws SQLException {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
@ -428,7 +427,7 @@ class WebCategoriesDataModel implements AutoCloseable {
|
|||||||
* @return The found entry or null.
|
* @return The found entry or null.
|
||||||
* @throws SQLException
|
* @throws SQLException
|
||||||
*/
|
*/
|
||||||
DomainCategory getRecordBySuffix(String domainSuffix) throws SQLException {
|
synchronized DomainCategory getRecordBySuffix(String domainSuffix) throws SQLException {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
@ -529,7 +528,9 @@ class WebCategoriesDataModel implements AutoCloseable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void close() throws SQLException {
|
public synchronized void close() throws SQLException {
|
||||||
|
if (dbConn != null) {
|
||||||
dbConn.close();
|
dbConn.close();
|
||||||
dbConn = null;
|
dbConn = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user