added exception handler

This commit is contained in:
Wisser
2023-02-14 23:19:57 +01:00
parent 547fc85d72
commit 5deb2ab156
2 changed files with 13 additions and 8 deletions
@@ -876,16 +876,20 @@ public class DbConnectionDialog extends javax.swing.JDialog {
}
});
if (connectionsTable != null) {
if (sci != null) {
int selectedRowIndex = connectionList.indexOf(sci);
if (selectedRowIndex >= 0) {
RowSorter<?> rowSorter = connectionsTable.getRowSorter();
selectedRowIndex = rowSorter.convertRowIndexToView(selectedRowIndex);
try {
if (sci != null) {
int selectedRowIndex = connectionList.indexOf(sci);
if (selectedRowIndex >= 0) {
connectionsTable.getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex);
connectionsTable.scrollRectToVisible(connectionsTable.getCellRect(selectedRowIndex, 0, true));
RowSorter<?> rowSorter = connectionsTable.getRowSorter();
selectedRowIndex = rowSorter.convertRowIndexToView(selectedRowIndex);
if (selectedRowIndex >= 0) {
connectionsTable.getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex);
connectionsTable.scrollRectToVisible(connectionsTable.getCellRect(selectedRowIndex, 0, true));
}
}
}
} catch (Exception e) {
// ignore
}
}
}
@@ -30,6 +30,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
@@ -2151,7 +2152,7 @@ public class ExtractionModelFrame extends javax.swing.JFrame {
extractionModelEditor.graphView.exportDisplayToImage(overviewImg, overviewHtml);
renderer.setOverviewHtml(Files.readAllLines(overviewHtml.toPath()).stream().collect(Collectors.joining(UIUtil.LINE_SEPARATOR)));
renderer.setOverviewHtml(Files.readAllLines(overviewHtml.toPath(), Charset.defaultCharset()).stream().collect(Collectors.joining(UIUtil.LINE_SEPARATOR)));
openHTMLRender(null);
overviewHtml.delete();
} catch (Throwable e) {