Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2974

writeToParcel throws NPE for optional enum fields

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2, 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: Java - Compiler
    • Labels:
      None

      Description

      The recent change to the Java compiler added generated Android compatible, parcelable Thrift objects.

      https://github.com/apache/thrift/commit/f9b8f5e64137248ea2a1b95312916491d23ab94a#diff-80220be8df49fb98fe5f899544d8368dR1569

      However, for optional enum fields that are null, getValue() will throw an NPE because no checks are made that the enum is set before being written.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                max.spencer Max Spencer
                Reporter:
                davidli David Li
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: