prevent null check error in send button

This commit is contained in:
ggurdin 2024-10-25 11:37:36 -04:00
parent 212632a913
commit df9f8e0916
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 5 additions and 1 deletions

View file

@ -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);

View file

@ -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,
),