{"record":{"id":"44f3eea1e5b9be0d","repo":"JetBrains/intellij-community","slug":"row-d-failed-hierarchicalidx-cannot-be-null","errorCode":null,"errorMessage":"Row %d failed: hierarchicalIdx cannot be null","messagePattern":"Row (.+?) failed: hierarchicalIdx cannot be null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"grid/core-impl/src/datagrid/HierarchicalColumnsDataGridModel.java","lineNumber":404,"sourceCode":"        Object value = tryExtractValueByHierarchicalIndex(rowValues, columnPath, rowIdx+1);\n\n        return value == null ? null : value.toString();\n      })\n      .limit(200)\n      .collect(Collectors.toList());\n\n    return CsvImportUtil.getPreferredTypeMergerBasedOnContent(\n      values, STRING_MERGER, INTEGER_MERGER, BIG_INTEGER_MERGER, DOUBLE_MERGER, BOOLEAN_MERGER);\n  }\n\n  private static Object getValue(GridRow row, int[] hierarchicalIdx) {\n    validateHierarchicalIndex(hierarchicalIdx, row.getRowNum());\n    return tryExtractValueByHierarchicalIndex(GridRow.getValues(row), hierarchicalIdx, row.getRowNum());\n  }\n\n  private static void validateHierarchicalIndex(int[] hierarchicalIdx, int rowNum) {\n    if (hierarchicalIdx == null) {\n      throw new IllegalArgumentException(\n        String.format(\"Row %d failed: hierarchicalIdx cannot be null\", rowNum)\n      );\n    }\n\n    if (hierarchicalIdx.length == 0) {\n      throw new IllegalArgumentException(\n        String.format(\"Row %d access failed: hierarchicalIdx cannot be empty\", rowNum)\n      );\n    }\n  }\n\n  private static @Nullable Object tryExtractValueByHierarchicalIndex(Object[] topLevelValues, int[] hierarchicalIdx, int rowNum) {\n    try {\n      return extractValueByHierarchicalIndex(topLevelValues, hierarchicalIdx);\n    } catch (IndexOutOfBoundsException | NullPointerException | IllegalArgumentException e) {\n      throw new RuntimeException(String.format(\"Row %d access failed: %s\", rowNum, e.getMessage()), e);\n    }\n  }","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/grid/core-impl/src/datagrid/HierarchicalColumnsDataGridModel.java#L386-L422","documentation":"HierarchicalColumnsDataGridModel.getValue(row, hierarchicalIdx) throws IllegalArgumentException when the hierarchical column path passed by the caller is null. The path (int[] of nesting levels) is mandatory: validateHierarchicalIndex checks it before any traversal of the row's nested value arrays.","triggerScenarios":"Calling getValue/setValue style accessors with a null int[] hierarchical index — commonly a caller that resolved the path from a GridColumn whose hierarchy was not initialized, or a default-parameter null slipping through.","commonSituations":"New code paths (custom renderers, exporters) that assume flat columns and pass null; refactoring that makes path computation optional without a fallback.","solutions":["Compute the hierarchical index from the column (e.g. column's path in the columns hierarchy) and pass a non-null int[].","Add a null check at the call site and fail fast with context about which column produced the null path.","For flat access, use the top-level value APIs instead of hierarchical ones."],"exampleFix":"// before\nObject v = getValue(row, null);\n\n// after\nint[] path = column.getHierarchicalIdx(); // never null for live columns\nObject v = getValue(row, path);","handlingStrategy":"validation","validationCode":"if (hierarchicalIdx == null) throw new IllegalArgumentException(\"hierarchicalIdx required for column \" + column.getName());","typeGuard":"static boolean hasHierarchicalIdx(@Nullable int[] idx) { return idx != null; }","tryCatchPattern":null,"preventionTips":["Derive the path from the live column object; never hand-build null placeholders.","Fail fast at the call boundary with the column identity in the message."],"tags":["datagrid","hierarchical-columns","validation","null-argument"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}