Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-1205

Empty JSon object lead to NPE

Apply templateInsert Lucidchart DiagramXMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.1.3
    • None
    • None
    • All
    • Small

      Similar to https://jira.talendforge.org/browse/TCOMP-1197

      When testing tacokit component using beam there is an NPE in this code:

      package org.talend.sdk.component.runtime.beam.spi.record;
      public class SchemaIdGenerator {
      ...
      private static long fingerprint(final List<Schema.Field> fields) {
      return SchemaNormalization
      .parsingFingerprint64(Schema
      .createRecord(fields
      .stream()
      ...

      'fields' is a Null
      -------------------------------
      it happens when I return this JsonObject from 'next' @Producer:

      {"createdDateTime":"2018-10-30T06:55:37Z","id":"01QB6TFI56Y2GOVW7725BZO354PWSELRRZ","lastModifiedDateTime":"2018-11-29T14:00:18Z","name":"root","webUrl":"https://talend365-my.sharepoint.com/personal/rd_dev_component_talend_com/Documents","size":126,"parentReference":

      {"driveId":"b!vA0VBwRaJ02UHlYb05Xs2JbkVJuJpvtBspftiL_xIAXVyJGFANHlRJwop0FYRGR2","driveType":"business"}

      ,"fileSystemInfo":{"createdDateTime":"2018-10-30T06:55:37Z","lastModifiedDateTime":"2018-11-29T14:00:18Z"},"folder":{"childCount":1},"root":{}}

       

      The problem is with empty 'root' property.
      -------------------------------
      and the stack trace:

      ---------------------------------
      <component-api.version>1.1.1</component-api.version>
      <component-runtime.version>1.1.3-SNAPSHOT</component-runtime.version>
      <beam.version>2.6.0</beam.version>

            rmannibucau Romain Manni-Bucau
            sbovsunovskyi Stanislav Bovsunovskyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: