Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception when saving

See original GitHub issue

gallery_saver: ^2.2.0 compileSdkVersion 30 targetSdkVersion 30

Fatal Exception: java.lang.NullPointerException
       at carnegietechnologies.gallery_saver.GallerySaver.finishWithSuccess(GallerySaver.kt:77)
       at carnegietechnologies.gallery_saver.GallerySaver.access$finishWithSuccess(GallerySaver.kt:16)
       at carnegietechnologies.gallery_saver.GallerySaver$saveMediaFile$1.invokeSuspend(GallerySaver.kt:72)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at android.os.Handler.handleCallback(
       at android.os.Handler.dispatchMessage(
       at android.os.Looper.loop(
       at java.lang.reflect.Method.invoke(

can’t reproduce on my device but i can see many exceptions like this in crashlytics… any idea? thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

carlosfioricommented, Dec 23, 2021

Same here, but with pictures. If I try to save multiple images in sync they work fine. But if it’s in parallel, it crashes the app.


static Future<List<bool?>> downloadAllImages(List<String> urls) async {
  final distinctUrls = urls.toSet().toList();

  final results = <bool?>[];
  for (var url in distinctUrls) {
    final result = await GallerySaver.saveImage(url);
  return results;

Crashs the app:

static Future<List<bool?>> downloadAllImages(List<String> urls) async {
  final distinctUrls = urls.toSet().toList();

  return Future.wait(;
E/AndroidRuntime( 7464): java.lang.NullPointerException
E/AndroidRuntime( 7464): 	at carnegietechnologies.gallery_saver.GallerySaver.finishWithSuccess(GallerySaver.kt:79)
E/AndroidRuntime( 7464): 	at carnegietechnologies.gallery_saver.GallerySaver.access$finishWithSuccess(GallerySaver.kt:16)
E/AndroidRuntime( 7464): 	at carnegietechnologies.gallery_saver.GallerySaver$saveMediaFile$1.invokeSuspend(GallerySaver.kt:74)
E/AndroidRuntime( 7464): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime( 7464): 	at
E/AndroidRuntime( 7464): 	at android.os.Handler.handleCallback(
E/AndroidRuntime( 7464): 	at android.os.Handler.dispatchMessage(
E/AndroidRuntime( 7464): 	at android.os.Looper.loop(
E/AndroidRuntime( 7464): 	at
E/AndroidRuntime( 7464): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7464): 	at$
E/AndroidRuntime( 7464): 	at
I/Process ( 7464): Sending signal. PID: 7464 SIG: 9
Lost connection to device.
rensviscommented, Jan 5, 2022

I have exactly the same behavior as @carlosfiori. Would be great if there was a method that took a list of paths/urls.

Read more comments on GitHub >

github_iconTop Results From Across the Web throwing the wrong exception - java
I am using a jpa repository that extends from CrudRepository to save an object into a DB.
Read more >
Exception vs Saving - What's the difference? - WikiDiff |
As nouns the difference between exception and saving is that exception is the act of excepting or excluding; exclusion; restriction by taking out...
Read more >
Random Exception when saving an ASPX file Exception from ...
I had opened my solution in VS 2019 and made a few changes to an aspx file by copying text from a JIRA...
Read more >
"Unable to save configuration due to an unknown exception ...
This can occur when one or more of the files in the $IMPACT_HOME/uiproviderconfig/properties directory are missing newlines and multiple ...
Read more >
Catching exception when saving records
Catching exception when saving records ... -need to catch error for record locked. ... for #1 I am not using visualforce so I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found