prevent null check error in send button
This commit is contained in:
parent
212632a913
commit
df9f8e0916
2 changed files with 5 additions and 1 deletions
|
|
@ -593,6 +593,7 @@ class Choreographer {
|
|||
if (isFetching) return false;
|
||||
if (errorService.isError) return true;
|
||||
if (itEnabled && isRunningIT) return false;
|
||||
if (igc.igcTextData == null) return false;
|
||||
|
||||
final hasITMatches =
|
||||
igc.igcTextData!.matches.any((match) => match.isITStart);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,10 @@ class ChoreographerSendButtonState extends State<ChoreographerSendButton> {
|
|||
color: widget.controller.choreographer.assistanceState
|
||||
.stateColor(context),
|
||||
onPressed: () {
|
||||
widget.controller.choreographer.send(context);
|
||||
widget.controller.choreographer.canSendMessage
|
||||
? widget.controller.choreographer.send(context)
|
||||
: widget.controller.choreographer.igc
|
||||
.showFirstMatch(context);
|
||||
},
|
||||
tooltip: L10n.of(context)!.send,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue