{"record":{"id":"16b3ae8db1dbcf54","repo":"iOfficeAI/OfficeCLI","slug":"row-height-cannot-be-empty","errorCode":null,"errorMessage":"Row height cannot be empty.","messagePattern":"Row height cannot be empty\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Helpers.cs","lineNumber":128,"sourceCode":"            \"dk2\" or \"tx2\" or \"dark2\" or \"text2\" => 3u,\n            \"accent1\" => 4u,\n            \"accent2\" => 5u,\n            \"accent3\" => 6u,\n            \"accent4\" => 7u,\n            \"accent5\" => 8u,\n            \"accent6\" => 9u,\n            \"hlink\" or \"hyperlink\" => 10u,\n            \"folhlink\" or \"followedhyperlink\" => 11u,\n            _ => null\n        };\n\n    // CONSISTENCY(rc-units): Row height is in points in OOXML; this helper\n    // accepts bare numbers (treated as points, backward compat) as well as\n    // unit-qualified \"40pt\", \"40px\", \"1cm\", \"0.5in\" and returns points.\n    internal static double ParseRowHeightPoints(string value)\n    {\n        if (string.IsNullOrWhiteSpace(value))\n            throw new ArgumentException(\"Row height cannot be empty.\");\n        var trimmed = value.Trim();\n        double pts;\n        // Bare number → points (legacy behavior)\n        if (double.TryParse(trimmed, System.Globalization.NumberStyles.Float,\n                System.Globalization.CultureInfo.InvariantCulture, out var bare)\n            && !char.IsLetter(trimmed[^1]))\n        {\n            if (double.IsNaN(bare) || double.IsInfinity(bare))\n                throw new ArgumentException($\"Invalid 'height' value: '{value}'. Expected a finite number (row height in points, e.g. 15.75).\");\n            pts = bare;\n        }\n        else\n        {\n            // Unit-qualified: convert via EMU then back to points.\n            try\n            {\n                var emu = OfficeCli.Core.EmuConverter.ParseEmu(trimmed);\n                pts = emu / EmuConverter.EmuPerPointF;","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Helpers.cs#L110-L146","documentation":"Thrown by ParseRowHeightPoints when the 'height' value passed to a row property is null, empty, or whitespace. The helper is the single entry point that normalizes row-height input (bare points or unit-qualified) into the points value OOXML stores.","triggerScenarios":"Invoking set /Sheet/row[N] --prop height= with an empty value, or passing null/\"\" programmatically to a code path that calls ParseRowHeightPoints (the row Set handler, batch emitters, or import helpers).","commonSituations":"An agent or script that builds the prop string dynamically leaving height blank when a source field is missing; templating code that interpolates an undefined variable; CI runs that pass --prop height=$HEIGHT with HEIGHT unset.","solutions":["Provide an explicit height value: a bare number (points) or a unit-qualified string (40pt, 40px, 1cm, 0.5in).","Skip setting height entirely if no value is intended rather than passing an empty string.","In calling code, guard with string.IsNullOrWhiteSpace(value) before invoking the Set path."],"exampleFix":"// before\nset /Sheet1/row[5] --prop height=\n\n// after\nset /Sheet1/row[5] --prop height=15.75\n// or unit-qualified\nset /Sheet1/row[5] --prop height=20pt","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(heightValue))\n    throw new ArgumentException(\"Provide a row height (bare points or e.g. 20pt).\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Skip the height prop entirely when no value is intended instead of passing an empty string.","In dynamic prop builders, omit keys whose source field is null or whitespace."],"tags":["excel","validation","row-height","units"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}