Skip to content

Commit 9b25546

Browse files
committed
fix: replace unhandled throw with logger.e in FAQ screen launchUrl
_launchURL() in faq_screen.dart threw a raw string when canLaunchUrl returned false. This throw was never caught at the call site (onTap: () => _launchURL(faq.linkUrl!)), so it propagated up and crashed the app instead of failing gracefully. Replaced the throw with logger.e(), consistent with how launchUrl failures are already handled in about_us_screen.dart. Fixes #3384
1 parent 99ccd51 commit 9b25546

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/view/faq_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:pslab/l10n/app_localizations.dart';
3+
import 'package:pslab/others/logger_service.dart';
34
import 'package:pslab/providers/locator.dart';
45
import 'package:pslab/theme/colors.dart';
56
import 'package:pslab/view/widgets/main_scaffold_widget.dart';
@@ -147,7 +148,7 @@ class FAQScreen extends StatelessWidget {
147148
if (await canLaunchUrl(uri)) {
148149
await launchUrl(uri);
149150
} else {
150-
throw '${appLocalizations.launchError} $url';
151+
logger.e('${appLocalizations.launchError} $url');
151152
}
152153
}
153154
}

0 commit comments

Comments
 (0)