Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-837

There are missing null check

    XMLWordPrintable

Details

    Description

      For best practices, null check should be add before access document from bucket.
      for example in RawJsonDocument:
      RawJsonDocument read = bucket.get("rawJsonDoc",RawJsonDocument.class);
      if(read != null)
      System.out.println(read);

      JsonDocument doc = bucket.get("rawJsonDoc");
      if(doc != null)
      System.out.println(doc.content().getBoolean("active"));

      p.s. you can also put try-catch in insert method.

      Reporter: kfir fersht
      E-mail: kfirfer@gmail.com

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            daschl Michael Nitschinger
            docsite-collector Docs Site Collector
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty