Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-195

NullPointerException in Mongo.close() if no connections present

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 2.3
    • Affects Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fedora Linux hp1 2.6.34.6-54.fc13.x86_64 #1 SMP Sun Sep 5 17:16:27 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

      The following code

      public static void main(String[] args) {
      try

      { Mongo m = new Mongo("192.168.1.16",27017); m.close(); }

      catch (Exception e)

      { e.printStackTrace(); }

      }

      I get the following stacktrace:

      java.lang.NullPointerException
      at com.mongodb.DBTCPConnector.close(DBTCPConnector.java:352)
      at com.mongodb.Mongo.close(Mongo.java:297)
      at com.example.MongoError.main(MongoError.java:11)

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            skoufos Lucas Zamboulis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: