diff --git a/src/main/gui/net/sf/jailer/ui/DbConnectionDialog.java b/src/main/gui/net/sf/jailer/ui/DbConnectionDialog.java index 6c09d2680..994fcd545 100644 --- a/src/main/gui/net/sf/jailer/ui/DbConnectionDialog.java +++ b/src/main/gui/net/sf/jailer/ui/DbConnectionDialog.java @@ -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 } } } diff --git a/src/main/gui/net/sf/jailer/ui/ExtractionModelFrame.java b/src/main/gui/net/sf/jailer/ui/ExtractionModelFrame.java index b511c656b..24b6be801 100644 --- a/src/main/gui/net/sf/jailer/ui/ExtractionModelFrame.java +++ b/src/main/gui/net/sf/jailer/ui/ExtractionModelFrame.java @@ -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) {