{"record":{"id":"4543ff2cbc5a3a2c","repo":"pentaho/pentaho-kettle","slug":"ifnull-log-selectvaluetypesempty","errorCode":null,"errorMessage":"IfNull.Log.SelectValueTypesEmpty","messagePattern":"IfNull\\.Log\\.SelectValueTypesEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/ifnull/IfNull.java","lineNumber":142,"sourceCode":"            data.defaultMasks[i] = environmentSubstitute( meta.getValueTypes()[i].getTypereplaceMask() );\n            data.setEmptyString[i] = meta.getValueTypes()[i].isSetTypeEmptyString();\n          }\n\n          HashSet<Integer> fieldsSelectedIndex = new HashSet<Integer>();\n          for ( int i = 0; i < data.outputRowMeta.size(); i++ ) {\n            ValueMetaInterface fieldMeta = data.outputRowMeta.getValueMeta( i );\n            if ( data.ListTypes.containsKey( fieldMeta.getTypeDesc() ) ) {\n              fieldsSelectedIndex.add( i );\n            }\n          }\n          data.fieldnrs = new int[fieldsSelectedIndex.size()];\n          List<Integer> entries = new ArrayList<Integer>( fieldsSelectedIndex );\n          Integer[] fieldnr = entries.toArray( new Integer[entries.size()] );\n          for ( int i = 0; i < fieldnr.length; i++ ) {\n            data.fieldnrs[i] = fieldnr[i];\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"IfNull.Log.SelectValueTypesEmpty\" ) );\n        }\n\n      } else {\n        data.realReplaceByValue = environmentSubstitute( meta.getReplaceAllByValue() );\n        data.realconversionMask = environmentSubstitute( meta.getReplaceAllMask() );\n        data.realSetEmptyString = meta.isSetEmptyStringAll();\n\n        // Consider all fields in input stream\n        data.fieldnrs = new int[data.outputRowMeta.size()];\n        for ( int i = 0; i < data.outputRowMeta.size(); i++ ) {\n          data.fieldnrs[i] = i;\n        }\n      }\n      data.fieldnr = data.fieldnrs.length;\n    } // end if first\n\n    try {\n      updateFields( r );","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/ifnull/IfNull.java#L124-L160","documentation":"Message key IfNull.Log.SelectValueTypesEmpty raised in IfNull.processRow: the 'Select value types' list was selected but contains no value types, so the step cannot determine which fields to apply null-replacement masks to and stops with this localized error.","triggerScenarios":"processRow with meta.isSelectValuesType() true and meta.getValueTypes() == null || length == 0.","commonSituations":"Step saved without selecting any value types; configuration lost during XML/repository load; step built programmatically without setValueTypes(); selected type list emptied after an upgrade migration.","solutions":["Open the If Null step and select at least one value type with its replacement value","If configuring in code, call meta.setValueTypes(...) with non-empty array before adding the step to the transformation","Re-save the transformation after fixing so the repository record is updated"],"exampleFix":"// before\nmeta.setSelectValuesType(true); // no types\n// after\nmeta.setSelectValuesType(true);\nmeta.setValueTypes(new IfNullValueType[] { new IfNullValueType(\"Number\", \"0\", null) });","handlingStrategy":"validation","validationCode":"IfNullValueType[] vts = meta.getValueTypes(); if (vts == null || vts.length == 0) throw new IllegalStateException(\"No value types selected\");","typeGuard":"boolean hasValueTypes(IfNullMeta m) { return m.getValueTypes() != null && m.getValueTypes().length > 0; }","tryCatchPattern":"try { trans.execute(null); } catch (KettleException e) { if (e.getMessage().contains(\"SelectValueTypesEmpty\")) { fixStepConfig(); } else { throw e; } }","preventionTips":["Run CheckResults before executing transformations","Don't ship steps with empty selection lists","Re-validate configs after upgrades or migrations"],"tags":["kettle","transformation","empty-config"],"backgroundTag":"empty-required-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}