Preventing NPE
authorJan Lahoda <jlahoda@netbeans.org>
Tue, 28 Jun 2011 16:03:00 +0200
changeset 61342e4e6a66230
parent 612 70b9ea6d69f6
child 614 22655f5f498e
Preventing NPE
remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java
     1.1 --- a/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Tue Jun 28 13:42:12 2011 +0200
     1.2 +++ b/remoting/ide/jumpto/src/org/netbeans/modules/jackpot30/jumpto/RemoteGoToType.java	Tue Jun 28 16:03:00 2011 +0200
     1.3 @@ -93,8 +93,12 @@
     1.4          for (RemoteIndex ri : RemoteIndex.loadIndices()) {
     1.5              try {
     1.6                  URI resolved = new URI(ri.remote.toExternalForm() + "/type/search?path=" + WebUtilities.escapeForQuery(ri.remoteSegment) + "&prefix=" + WebUtilities.escapeForQuery(context.getText()));
     1.7 +                String response = WebUtilities.requestStringResponse(resolved);
     1.8 +
     1.9 +                if (response == null) continue;
    1.10 +                
    1.11                  @SuppressWarnings("unchecked") //XXX: should not trust something got from the network!
    1.12 -                Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, WebUtilities.requestStringResponse(resolved));
    1.13 +                Map<String, List<String>> types = Pojson.load(LinkedHashMap.class, response);
    1.14  
    1.15                  for (Entry<String, List<String>> e : types.entrySet()) {
    1.16                      for (String binaryName : e.getValue()) {