Changeset 8aeca5b4


Ignore:
Timestamp:
Jul 24, 2013 2:24:29 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a02cc258
Parents:
7b4855d7
Message:

catch NPE in main when no state table available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/UPnP.java

    r7b4855d7 r8aeca5b4  
    395395        /** debug only */
    396396        private static void listStateTable(Service serv, StringBuilder sb) {
    397                 ServiceStateTable table = serv.getServiceStateTable();
     397                ServiceStateTable table;
     398                try {
     399                        table = serv.getServiceStateTable();
     400                } catch (Exception e) {
     401                        // getSCPDNode() returns null,
     402                        // NPE at org.cybergarage.upnp.Service.getServiceStateTable(Service.java:526)
     403                        sb.append(" : no state");
     404                        return;
     405                }
    398406                sb.append("<ul><small>");
    399407                for(int i=0; i<table.size(); i++) {
     
    929937                UPnP upnp = new UPnP(ctx);
    930938                ControlPoint cp = new ControlPoint();
    931                 System.out.println("Searching for up&p devices:");
     939                System.out.println("Searching for UPnP devices:");
    932940                cp.start();
    933941                cp.search();
Note: See TracChangeset for help on using the changeset viewer.