From 1c0643ac3e843b21f801ffe2ad3bf79b9ce93cb2 Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Fri, 29 Jun 2018 13:15:23 -0600 Subject: [PATCH] removed exception handling in favor of null checking --- .../CommonFilesSearchResultsViewerTable.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesSearchResultsViewerTable.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesSearchResultsViewerTable.java index c005799782..cacbdd83f9 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesSearchResultsViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesSearchResultsViewerTable.java @@ -43,6 +43,8 @@ public class CommonFilesSearchResultsViewerTable extends DataResultViewerTable { private static final long serialVersionUID = 1L; private static final Logger LOGGER = Logger.getLogger(CommonFilesSearchResultsViewerTable.class.getName()); + + private static final int DEFAULT_WIDTH = 100; static { Map map = new HashMap<>(); @@ -79,10 +81,11 @@ public class CommonFilesSearchResultsViewerTable extends DataResultViewerTable { final Integer defaultWidth = COLUMN_WIDTHS.get(headerValue); - try { + if(defaultWidth == null){ + column.setPreferredWidth(DEFAULT_WIDTH); + LOGGER.log(Level.SEVERE, String.format("Tried to set width on a column not supported by the CommonFilesSearchResultsViewerTable: %s", headerValue)); + } else { column.setPreferredWidth(defaultWidth); - } catch (Exception e) { - LOGGER.log(Level.SEVERE, String.format("Tried to set width on a column not supported by the CommonFilesSearchResultsViewerTable: %s", headerValue), e); } } }