dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
723 stars 169 forks source link

Input on incorrect position will crash the program. #30

Closed srayzhao closed 5 years ago

srayzhao commented 5 years ago

https://github.com/dwmkerr/consolecontrol/blob/1bdb679dcf030f1503b6b7988cc77ebda39559c9/source/ConsoleControl/ConsoleControl.cs#L182

Hi , This is a very good control tool. Thanks. When I debugged it in winform. If the cursor was not at the end of the consolecontrol, then any input would crash the program. Maybe : (richTextBoxConsole.SelectionStart) - inputStart , should be checked firstly. the result should be larger than zero.