mattreid1 / firebase_image

🔥 Cached Flutter ImageProvider for Firebase Cloud Storage
https://pub.dev/packages/firebase_image
ISC License
85 stars 69 forks source link

TypeError (type 'Null' is not a subtype of type 'Reference') #40

Closed 17martix closed 2 years ago

17martix commented 3 years ago

my app was crashing every time firebase_image was loading picture stating TypeError (type 'Null' is not a subtype of type 'Reference'). after looking into the code, it's the FirebaseImageObject.fromMap(Map<String, dynamic> map) method in image_object.dart causing the error because it's called with no value given to the reference key.

potential solution: make Reference variable in FirebaseImageObject nullable and it solves the problem.

Yayo-Arellano commented 3 years ago

I also have the same problem

======== Exception caught by image resource service ================================================
The following _TypeError was thrown resolving an image codec:
type 'Null' is not a subtype of type 'Reference'

When the exception was thrown, this was the stack: 
#0      new FirebaseImageObject.fromMap (package:firebase_image/src/image_object.dart:32:21)
#1      FirebaseImageCacheManager.get (package:firebase_image/src/cache_manager.dart:93:31)
<asynchronous suspension>
#2      FirebaseImage._fetchImage (package:firebase_image/src/firebase_image.dart:82:11)
<asynchronous suspension>
...
====================================================================================================
JErazo7 commented 3 years ago

Any solution?

difelice commented 3 years ago

~Duplicate~ You're right, thanks👇

blaugold commented 3 years ago

@difelice I don't think this is a duplicate of #37. That issue is about a warning of an unnecessary non-null assertion. This issue is about passing null to a non-null parameter at runtime and causing an exception.

ABleas commented 3 years ago

I'd love to use this package but right now it's not displaying images at all. Is there a work-around for this issue, other than waiting for the PR to be merged?

maeddin commented 3 years ago

It still does not work. My solution was to use the fork of #45 . Thanks to @blaugold

yelkamel commented 2 years ago

I have the same issue and the fork of #45 fixed the issue for me, please merge it :)

psimondk commented 2 years ago

I can only second @yelkamel as I have the same issue - please merge :)

kostodo commented 2 years ago

Same issue here.

janlektonen commented 2 years ago

I face the same issue after updating to version 1.1.0

mattreid1 commented 2 years ago

I was unable to replicate but I'll take a look now

mattreid1 commented 2 years ago

Ok, I merged #45 and released 1.1.1 so :crossed_fingers: that fixed it. As I was unable to replicate the problem, please let me know if it works so I can close the issue. Thanks!

mattreid1 commented 2 years ago

Going to close this issue now but if this is still a problem then feel free to reopen it!

yelkamel commented 2 years ago

this work for me thank you :) @mattreid1

psimondk commented 2 years ago

Nice work Matt - a very useful library - thanks for closing this issue

On Tue, Jan 25, 2022 at 3:56 PM LaYouceferie @.***> wrote:

this work for me thank you :) @mattreid1 https://github.com/mattreid1

— Reply to this email directly, view it on GitHub https://github.com/mattreid1/firebase_image/issues/40#issuecomment-1021268925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP6EPNNLV6TKHGBS3VMU33UX223TANCNFSM42X52KTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>