Guard Scribe suggestion loading if interactor is null
This commit is contained in:
@@ -40,6 +40,15 @@ mixin AiScribeSuggestionStateMixin<T extends StatefulWidget> on State<T> {
|
|||||||
Future<void> loadSuggestion() async {
|
Future<void> loadSuggestion() async {
|
||||||
_suggestionState.value = dartz.Right(GenerateAITextLoading());
|
_suggestionState.value = dartz.Right(GenerateAITextLoading());
|
||||||
|
|
||||||
|
if (_interactor == null) {
|
||||||
|
_suggestionState.value = dartz.Left(
|
||||||
|
GenerateAITextFailure(
|
||||||
|
GenerateAITextInteractorIsNotRegisteredException(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final result = await _interactor!.execute(
|
final result = await _interactor!.execute(
|
||||||
aiAction,
|
aiAction,
|
||||||
content,
|
content,
|
||||||
|
|||||||
Reference in New Issue
Block a user