diff --git a/RgssDecrypter/Program.EntryPoint.cs b/RgssDecrypter/Program.EntryPoint.cs index 75c2925..fe972f5 100644 --- a/RgssDecrypter/Program.EntryPoint.cs +++ b/RgssDecrypter/Program.EntryPoint.cs @@ -135,7 +135,12 @@ private static void PrintHeader() assName.Version, comName.Company); var len = header.Length; - header = "\x1B[" + ((Console.BufferWidth - len) / 2) + "G" + header; + try { + header = "\x1B[" + ((Console.BufferWidth - len) / 2) + "G" + header; + } + catch(IOException) { + // BufferWidth might not be available, e.g. when redirecting stdout + } Console.WriteLine(header); }