Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null check operator used on a null value #112

Open
hmbadhon opened this issue Nov 15, 2022 · 0 comments
Open

Null check operator used on a null value #112

hmbadhon opened this issue Nov 15, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@hmbadhon
Copy link

Description

.mp4 file compression is pretty good but when i pick .mov file to compress it's couldn't able to compress and file path throwing null exception.

Platform

IOS|Android|Both|Other

Code Example (if has)


for (var element in dto.media) {
      var file = await PhotoGallery.getFile(mediumId: element.id);
      Uint8List? data;
      if (element.mediumType == MediumType.image) {
        data = await AppUtils.compressToUint8List(
            file.path, element.height, element.width, 50);
        files.add(MultipartFile.fromBytes(data!,
            filename: getFileName(element.filename!)));
      } else {
        log("File name ===========> ${file.path}");
        log("Compress Start ===========> ${DateTime.now()}");
        try {
          showProgressDialogStatus(0);
          final response = await vc.VideoCompress.compressVideo(
            file.path,
            quality: vc.VideoQuality.MediumQuality,
            // deleteOrigin: false, // It's false by default
          );
          log("File path ===========> ${response!.path}");
          log("Compress end ===========> ${DateTime.now()}");

          var multipart = await MultipartFile.fromFile(response.path!,
              filename: getFileName(response.path!));
          files.add(multipart);
        } catch (e) {
          log("compress error ===========> $e");
        }
      }
    }
 
@hmbadhon hmbadhon added the bug Something isn't working label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant