xterm.dart icon indicating copy to clipboard operation
xterm.dart copied to clipboard

Null check operator used on a null value

Open crioux opened this issue 1 year ago • 0 comments

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
package:xterm/src/utils/circular_buffer.dart 105:28                            IndexAwareCircularBuffer.[]
package:xterm/src/core/buffer/buffer.dart 135:17                               Buffer.currentLine
package:xterm/src/core/buffer/buffer.dart 121:18                               Buffer.writeChar
package:xterm/src/terminal.dart 389:13                                         Terminal.writeChar
package:xterm/src/core/escape/parser.dart 53:15                                EscapeParser._processChar
package:xterm/src/core/escape/parser.dart 46:9                                 EscapeParser._process
package:xterm/src/core/escape/parser.dart 31:5                                 EscapeParser.write
package:xterm/src/terminal.dart 228:13                                         Terminal.write

Getting this stack trace when I create a Terminal as such:

final globalDebugTerminal = Terminal(
  maxLines: 50000,
);

I have a log that is filling this globalDebugTerminal up without having any TerminalView widget created, and then when i go and create a TerminalView widget to view the contents as such:

            TerminalView(globalDebugTerminal,
                textStyle: kDefaultTerminalStyle,
                controller: _terminalController,
                //autofocus: true,
                backgroundOpacity: _showEllet ? 0.75 : 1.0,
                onSecondaryTapDown: (details, offset) async {
              await copySelection(context);
            })

It throws the exception above.

crioux avatar Jun 02 '24 20:06 crioux