Skip to content

Commit

Permalink
🐛 Fix potential nil class value when unwrapping caught exceptions on …
Browse files Browse the repository at this point in the history
…Darwin (#1249)
  • Loading branch information
AlexV525 authored Dec 28, 2024
1 parent 2c0669f commit f25f8b8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/runnable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ jobs:
# run: flutter analyze example_ohos
- name: Run tests
run: flutter test
- name: Generate docs
run: |
dart pub global activate dartdoc
dart pub global run dartdoc .
- name: Dry run docs generate
run: dart doc --dry-run .

publishable:
if: github.repository == 'fluttercandies/flutter_photo_manager'
Expand Down Expand Up @@ -87,7 +85,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
permissions:
permissions:
pull-requests: write
issues: write
steps:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ To know more about breaking changes, see the [Migration Guide][].

*None.*

## 3.6.4

### Fixes

- Fix potential nil class value when unwrapping caught exceptions on Darwin.

## 3.6.3

### Improvements
Expand Down
11 changes: 6 additions & 5 deletions example/lib/page/developer/verbose_log_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ class _VerboseLogPageState extends State<VerboseLogPage> {
final item = logList[index];
return ListTile(
title: content(item.log),
tileColor: item.isResultLog
? Colors.green.withOpacity(0.1)
: item.isInvokeLog
? Colors.blue.withOpacity(0.1)
: null,
tileColor: (item.isResultLog
? Colors.green
: item.isInvokeLog
? Colors.blue
: null)
?.withAlpha(16),
subtitle: item.swTime != null
? Text('Time: ${item.swTime}ms')
: null,
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/ResultHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void)replyError:(NSObject *)value {
NSString *details = exception.callStackSymbols ? [exception.callStackSymbols componentsJoinedByString:@"\n"] : @"No stack trace available.";
flutterError = [FlutterError errorWithCode:code message:message details:details];
} else {
NSString *code = NSStringFromClass([value class]);
NSString *code = NSStringFromClass([value class]) ?: @"UnknownException";
NSString *message = [NSString stringWithFormat:@"%@", [value description]];
flutterError = [FlutterError errorWithCode:code message:message details:nil];
}
Expand Down
4 changes: 0 additions & 4 deletions lib/src/internal/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ extension PMDarwinAssetCollectionTypeExt on PMDarwinAssetCollectionType {
///
/// The define of the subtype of the collection.
///
/// <details>
///
/// ```objc
/// typedef NS_ENUM(NSInteger, PHAssetCollectionSubtype) {
///
Expand Down Expand Up @@ -210,8 +208,6 @@ extension PMDarwinAssetCollectionTypeExt on PMDarwinAssetCollectionType {
/// PHAssetCollectionSubtypeAny = NSIntegerMax
/// };
/// ```
///
/// </details>
enum PMDarwinAssetCollectionSubtype {
// PHAssetCollectionTypeAlbum regular subtypes
albumRegular,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: photo_manager
description: A Flutter plugin that provides album assets abstraction management APIs on Android, iOS, macOS, and OpenHarmony.
repository: https://github.com/fluttercandies/flutter_photo_manager
version: 3.6.3
version: 3.6.4

environment:
sdk: ">=2.13.0 <4.0.0"
Expand Down

0 comments on commit f25f8b8

Please sign in to comment.