Skip to content

Commit f25f8b8

Browse files
authored
🐛 Fix potential nil class value when unwrapping caught exceptions on Darwin (#1249)
1 parent 2c0669f commit f25f8b8

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.github/workflows/runnable.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ jobs:
4646
# run: flutter analyze example_ohos
4747
- name: Run tests
4848
run: flutter test
49-
- name: Generate docs
50-
run: |
51-
dart pub global activate dartdoc
52-
dart pub global run dartdoc .
49+
- name: Dry run docs generate
50+
run: dart doc --dry-run .
5351

5452
publishable:
5553
if: github.repository == 'fluttercandies/flutter_photo_manager'
@@ -87,7 +85,7 @@ jobs:
8785
strategy:
8886
matrix:
8987
os: [ ubuntu-latest ]
90-
permissions:
88+
permissions:
9189
pull-requests: write
9290
issues: write
9391
steps:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ To know more about breaking changes, see the [Migration Guide][].
1010

1111
*None.*
1212

13+
## 3.6.4
14+
15+
### Fixes
16+
17+
- Fix potential nil class value when unwrapping caught exceptions on Darwin.
18+
1319
## 3.6.3
1420

1521
### Improvements

example/lib/page/developer/verbose_log_page.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ class _VerboseLogPageState extends State<VerboseLogPage> {
124124
final item = logList[index];
125125
return ListTile(
126126
title: content(item.log),
127-
tileColor: item.isResultLog
128-
? Colors.green.withOpacity(0.1)
129-
: item.isInvokeLog
130-
? Colors.blue.withOpacity(0.1)
131-
: null,
127+
tileColor: (item.isResultLog
128+
? Colors.green
129+
: item.isInvokeLog
130+
? Colors.blue
131+
: null)
132+
?.withAlpha(16),
132133
subtitle: item.swTime != null
133134
? Text('Time: ${item.swTime}ms')
134135
: null,

ios/Classes/ResultHandler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void)replyError:(NSObject *)value {
5959
NSString *details = exception.callStackSymbols ? [exception.callStackSymbols componentsJoinedByString:@"\n"] : @"No stack trace available.";
6060
flutterError = [FlutterError errorWithCode:code message:message details:details];
6161
} else {
62-
NSString *code = NSStringFromClass([value class]);
62+
NSString *code = NSStringFromClass([value class]) ?: @"UnknownException";
6363
NSString *message = [NSString stringWithFormat:@"%@", [value description]];
6464
flutterError = [FlutterError errorWithCode:code message:message details:nil];
6565
}

lib/src/internal/enums.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ extension PMDarwinAssetCollectionTypeExt on PMDarwinAssetCollectionType {
168168
///
169169
/// The define of the subtype of the collection.
170170
///
171-
/// <details>
172-
///
173171
/// ```objc
174172
/// typedef NS_ENUM(NSInteger, PHAssetCollectionSubtype) {
175173
///
@@ -210,8 +208,6 @@ extension PMDarwinAssetCollectionTypeExt on PMDarwinAssetCollectionType {
210208
/// PHAssetCollectionSubtypeAny = NSIntegerMax
211209
/// };
212210
/// ```
213-
///
214-
/// </details>
215211
enum PMDarwinAssetCollectionSubtype {
216212
// PHAssetCollectionTypeAlbum regular subtypes
217213
albumRegular,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: photo_manager
22
description: A Flutter plugin that provides album assets abstraction management APIs on Android, iOS, macOS, and OpenHarmony.
33
repository: https://github.com/fluttercandies/flutter_photo_manager
4-
version: 3.6.3
4+
version: 3.6.4
55

66
environment:
77
sdk: ">=2.13.0 <4.0.0"

0 commit comments

Comments
 (0)