浏览代码

add null check

xuty 5 年之前
父节点
当前提交
1f375d25e6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/frontend/terminal_view.dart

+ 2 - 1
lib/frontend/terminal_view.dart

@@ -51,7 +51,8 @@ class TerminalView extends StatefulWidget {
     this.fontFamily = _kDefaultFontFamily,
     this.fontWidthScaleFactor = 1.0,
     this.fontHeightScaleFactor = 1.1,
-  }) : super(key: key ?? ValueKey(terminal));
+  })  : assert(terminal != null),
+        super(key: key ?? ValueKey(terminal));
 
   final Terminal terminal;
   final ResizeHandler onResize;