зеркало из https://github.com/xamarin/XtermSharp.git
Add null checking to SelectionService
It seems that it is somehow possible to hit a NRE when selecting text. See https://devdiv.visualstudio.com/DevDiv/_queries/edit/1582556
This commit is contained in:
Родитель
fe59fadc22
Коммит
17dfff50f0
|
@ -283,7 +283,7 @@ namespace XtermSharp {
|
|||
|
||||
// get the first line
|
||||
BufferLine bufferLine = buffer.Lines [start.Y];
|
||||
if (bufferLine.HasAnyContent ()) {
|
||||
if (bufferLine != null && bufferLine.HasAnyContent ()) {
|
||||
str = TranslateBufferLineToString (buffer, start.Y, start.X, start.Y < end.Y ? -1 : end.X);
|
||||
|
||||
var fragment = new LineFragment (str, start.Y, start.X);
|
||||
|
@ -334,7 +334,7 @@ namespace XtermSharp {
|
|||
// get the last row
|
||||
if (end.Y != start.Y) {
|
||||
bufferLine = buffer.Lines [end.Y];
|
||||
if (bufferLine.HasAnyContent ()) {
|
||||
if (bufferLine != null && bufferLine.HasAnyContent ()) {
|
||||
addBlanks ();
|
||||
|
||||
isWrapped = bufferLine?.IsWrapped ?? false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче