File tree Expand file tree Collapse file tree
kse/src/main/java/org/kse/gui/dialogs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,7 +237,8 @@ private String[] getLibraryList() {
237237 private void browsePressed () {
238238 JFileChooser chooser = FileChooserFactory .getLibFileChooser ();
239239
240- File currentLibFile = new File (((String ) jtfP11Library .getSelectedItem ()).trim ());
240+ String selectedItem = jtfP11Library .getSelectedItem () != null ? (String ) jtfP11Library .getSelectedItem () : "" ;
241+ File currentLibFile = new File (selectedItem .trim ());
241242
242243 if (currentLibFile .getParentFile () != null && currentLibFile .getParentFile ().exists ()) {
243244 chooser .setCurrentDirectory (currentLibFile .getParentFile ());
@@ -261,8 +262,9 @@ private void browsePressed() {
261262 }
262263
263264 private void okPressed () {
265+ Object selectedItem = jtfP11Library .getSelectedItem ();
266+ final String selectedLib = (selectedItem != null ) ? ((String ) selectedItem ).trim () : "" ;
264267
265- final String selectedLib = ((String ) jtfP11Library .getSelectedItem ()).trim ();
266268 try {
267269 if (jrbUseExisting .isSelected ()) {
268270
You can’t perform that action at this time.
0 commit comments