{"record":{"id":"831e65ee3ce8d15a","repo":"flowable/flowable-engine","slug":"tablename-is-null","errorCode":null,"errorMessage":"tableName is null","messagePattern":"tableName is null","errorType":"validation","errorClass":"org.flowable.common.engine.api.FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/cmd/GetTableMetaDataCmd.java","lineNumber":40,"sourceCode":"/**\n * @author Joram Barrez\n */\npublic class GetTableMetaDataCmd implements Command<TableMetaData>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    \n    protected String tableName;\n    protected String engineType;\n\n    public GetTableMetaDataCmd(String tableName, String engineType) {\n        this.tableName = tableName;\n        this.engineType = engineType;\n    }\n\n    @Override\n    public TableMetaData execute(CommandContext commandContext) {\n        if (tableName == null) {\n            throw new FlowableIllegalArgumentException(\"tableName is null\");\n        }\n        return commandContext.getEngineConfigurations().get(engineType).getTableDataManager().getTableMetaData(tableName);\n    }\n\n}\n","sourceCodeStart":22,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/cmd/GetTableMetaDataCmd.java#L22-L46","documentation":"GetTableMetaDataCmd.execute validates its tableName field before querying table metadata via the engine's TableDataManager. If the command was constructed with a null table name, it throws FlowableIllegalArgumentException. This is a guard against issuing a meaningless metadata lookup against the database.","triggerScenarios":"Calling GetTableMetaDataCmd (e.g. via managementService.executeCommand(new GetTableMetaDataCmd(engineType, null))) or invoking the management-service table metadata API with a null tableName argument.","commonSituations":"Programmatic table inspection tools passing a dynamically-resolved table name that turns out null; copying example code and forgetting to set the table name; refactoring that removed the name argument.","solutions":["Pass a valid, non-null table name when constructing GetTableMetaDataCmd (e.g. \"ACT_RU_TASK\").","Null-check / validate the table name before creating and executing the command.","If the name comes from user input or config, trim and validate it before dispatching the command."],"exampleFix":"// before\nnew GetTableMetaDataCmd(engineType, tableName).execute(commandContext);\n// after\nif (tableName == null) throw new IllegalArgumentException(\"tableName required\");\nnew GetTableMetaDataCmd(engineType, tableName).execute(commandContext);","handlingStrategy":"validation","validationCode":"if (tableName == null || tableName.trim().isEmpty()) throw new IllegalArgumentException(\"tableName must be a non-empty Flowable table name\");","typeGuard":null,"tryCatchPattern":"try { return managementService.executeCommand(new GetTableMetaDataCmd(engineType, table)); } catch (FlowableIllegalArgumentException e) { return null; }","preventionTips":["Null-check table names resolved from config or user input before executing the command","Use constants for known Flowable table names (ACT_RU_TASK, ACT_HI_PROCINST, ...)","Centralize table-metadata lookups in one utility that validates input"],"tags":["validation","null-argument","database-metadata"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}