Commit c718642

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-03-11 07:34:42
fix possible format jsonDecode exception
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 1c4ea25
Changed files (1)
lib
model
export_import
lib/model/export_import/column.dart
@@ -72,9 +72,9 @@ class NativeColumn extends ExportColumn {
       RowDataFieldType.needlePin,
       (record) => jsonEncode(record.needlePin?.toMap()),
       (pattern) {
-        final json = jsonDecode(pattern);
-        if (json is! Map<String, dynamic>) return null;
         try {
+          final json = jsonDecode(pattern);
+          if (json is! Map<String, dynamic>) return null;
           return MeasurementNeedlePin.fromMap(json);
         } on FormatException {
           return null;