Commits

Jan Lahoda committed a8079bf

Preventing various exception in the RemoteIndices dialog

Comments (0)

Files changed (1)

api/src/org/netbeans/modules/jackpot30/impl/indexing/options/CustomizeRemoteIndex.java

                 checkingIndexURLError.set(ex.getLocalizedMessage());
             } catch (MalformedURLException ex) {
                 checkingIndexURLError.set(ex.getLocalizedMessage());
+            } catch (ThreadDeath td) {
+                throw td;
+            } catch (Throwable t) {//#6541019
+                checkingIndexURLError.set("Invalid URL");
             }
             
             checkingIndexURL.set(false);
                 public void run() {
                     updateErrors();
 
-                    if (subindicesFinal == null) return;
+                    if (subindicesFinal == null || subindicesFinal.isEmpty()) return;
 
                     DefaultComboBoxModel model = (DefaultComboBoxModel) subIndex.getModel();
                     String selected = (String) model.getSelectedItem();
                 String indexInfoText = WebUtilities.requestStringResponse(url.toURI().resolve("info?path=" + WebUtilities.escapeForQuery(subIndex)));
                 info = IndexInfo.empty();
 
-                Pojson.update(info, indexInfoText);
+                if (indexInfoText != null)
+                    Pojson.update(info, indexInfoText);
             } catch (URISyntaxException ex) {
                 Logger.getLogger(CustomizeRemoteIndex.class.getName()).log(Level.FINE, null, ex);
             } catch (MalformedURLException ex) {