jonataslaw / jonataslaw/VideoCompress
Null check operator used on a null value
- Dominant language
- Swift
- Stars
- 262
- Forks
- 344
- PR merge metrics
- No merged PRs in 30d
Description
# Unhandled Exception: Null check operator used on a null value
I am encountering an error when trying to compress videos. I am testing the app on an Iphone 12 pro.
I have tried using the following versions of the package:
- 3.1.1
- 3.1.0
- 3.0.0
My system:
- Computer: Macbook pro m1 13 (Monterey 12.4)
- Phone for testing: Iphone 12 pro (15.5)
- IDE: Visual Studio Code
- Flutter version: 3.0.3
My code:
```dart
print("before compression");
final info = await VideoCompress.compressVideo(
widget.filePath,
quality: VideoQuality.MediumQuality,
deleteOrigin: false,
includeAudio: false,
);
print("after compression");
setState(() {
compressedInfo = info!.path!; // Dart complains if I don't run a null-check here
print("info set");
});
```
Error:
```
The selected imageFormatGroup is not supported by iOS. Defaulting to brga8888
flutter: before compression
flutter: VideoCompress: You can try to subscribe to the
flutter: compressProgress$ stream to know the compressing state.
[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: Null check operator used on a null value
#0 new MediaInfo.fromJson (package:video_compress/src/media/media_info.dart:43:21)
#1 Compress.compressVideo (package:video_compress/src/video_compress/video_compressor.dart:154:24)
#2 _VideoPageState.build. (package:apiir_bikefit/pages/record/video_page.dart:65:28)
```
I first assumed that there was something wrong with the way I was handling the result of the compression (`info`) or that I had implemented the async await wrong. However, after trying different methods and researching online I can't seem to find the problem.
Additionally, it seems that `print("after compression");` is never reached, indicating that there is something wrong with the compression function (though I'm not 100% sure).
Could this be a bug in the package?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.