From f88d399f0f9eaa6f3009d3ff0383ea4e1a1f70d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Herceg?= Date: Fri, 8 Mar 2024 14:42:52 +0100 Subject: [PATCH] Fixed crashing compilation page on OWIN --- src/Framework/Framework/Compilation/DotHtmlFileInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Framework/Framework/Compilation/DotHtmlFileInfo.cs b/src/Framework/Framework/Compilation/DotHtmlFileInfo.cs index c9dee547c3..157d452568 100644 --- a/src/Framework/Framework/Compilation/DotHtmlFileInfo.cs +++ b/src/Framework/Framework/Compilation/DotHtmlFileInfo.cs @@ -62,7 +62,7 @@ public sealed record CompilationDiagnosticViewModel( ) { public string? SourceLine { get; set; } = SourceLine; - public string? SourceLinePrefix => SourceLine?.Remove(ColumnNumber ?? 0); + public string? SourceLinePrefix => SourceLine?.Substring(0, ColumnNumber ?? 0); public string? SourceLineHighlight => HighlightLength is {} len ? SourceLine?.Substring(ColumnNumber ?? 0, len) : SourceLine?.Substring(ColumnNumber ?? 0);