Skip to content

Commit

Permalink
error handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryanidk committed Feb 29, 2024
1 parent c9a3684 commit 4f43148
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/screens/scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ class _ScanResultsPageState extends State<ScanResultsPage> {
if (result != null && !sentData) {
sentData = true;
String? resultData = result!.code;
Map? resultDataMap = jsonDecode(resultData!);
bool? isGame = resultDataMap!['isGame'] == "y" ? true : false;
resultDataMap.remove("isGame");
sendData(resultDataMap, isGame);
try {
Map? resultDataMap = jsonDecode(resultData!);
bool? isGame = resultDataMap!['isGame'] == "y" ? true : false;
resultDataMap.remove("isGame");
sendData(resultDataMap, isGame);
} catch (e) {
print('Error decoding JSON: $e');
}
}
});
}
Expand Down

0 comments on commit 4f43148

Please sign in to comment.