{"record":{"id":"54cae398de874723","repo":"spectreconsole/spectre.console","slug":"value-cannot-be-null-parameter-content-54cae3","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'content')","messagePattern":"Value cannot be null\\. \\(Parameter 'content'\\)","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Spectre.Console/Widgets/Table/TableCell.cs","lineNumber":24,"sourceCode":"public sealed class TableCell : IRenderable\n{\n    /// <summary>\n    /// Gets the cell content.\n    /// </summary>\n    public IRenderable Content { get; }\n\n    /// <summary>\n    /// Gets the number of columns this cell spans.\n    /// </summary>\n    public int ColumnSpan { get; set; }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"TableCell\"/> class.\n    /// </summary>\n    /// <param name=\"content\">The cell content.</param>\n    public TableCell(IRenderable content)\n    {\n        Content = content ?? throw new ArgumentNullException(nameof(content));\n        ColumnSpan = 1;\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"TableCell\"/> class.\n    /// </summary>\n    /// <param name=\"markup\">Markup text.</param>\n    public TableCell(string markup)\n        : this(new Markup(markup ?? string.Empty))\n    {\n    }\n\n    /// <summary>\n    /// Sets the number of columns this cell should span.\n    /// </summary>\n    /// <param name=\"span\">The number of columns to span.</param>\n    /// <returns>The same instance so that multiple calls can be chained.</returns>\n    public TableCell Span(int span)","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/spectreconsole/spectre.console/blob/0acc92fada6c42f13984e79c2b5f3d993bdfb099/src/Spectre.Console/Widgets/Table/TableCell.cs#L6-L42","documentation":"Thrown by the TableCell(IRenderable) constructor when the content argument is null. A cell must contain a renderable. The string overload coalesces null markup to string.Empty via new Markup(markup ?? string.Empty), so it tolerates null.","triggerScenarios":"Constructing 'new TableCell((IRenderable)null)' or passing a null IRenderable variable.","commonSituations":"Content renderable obtained from a method that can return null, or a conditional expression that yields null.","solutions":["Pass a non-null IRenderable.","Use the string overload 'new TableCell(markup)' which tolerates null.","Coalesce with '?? new Markup(string.Empty)'."],"exampleFix":"// before\nvar cell = new TableCell(maybeNullRenderable);\n\n// after\nvar cell = new TableCell(maybeNullRenderable ?? new Markup(string.Empty));","handlingStrategy":"type-guard","validationCode":"if (content is null) throw new ArgumentNullException(nameof(content));\nvar cell = new TableCell(content);","typeGuard":"static bool HasValidCellContent(IRenderable? content) => content is not null;","tryCatchPattern":null,"preventionTips":["Prefer the string overload new TableCell(markup) when content is a string.","Coalesce null renderables with new Markup(string.Empty)."],"tags":["table-cell","argument-null","constructor","spectre-console"],"backgroundTag":null,"analyzedSha":"0acc92fada6c42f13984e79c2b5f3d993bdfb099","analyzedAt":"2026-08-13T18:27:21.983Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}