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

fix: guard invalid blob creation #608

Merged
merged 2 commits into from Dec 15, 2022

Conversation

hansemannn
Copy link
Contributor

@hansemannn hansemannn commented Dec 14, 2022

Caused by missing memory (which can happen). The error is Uncaught Error: Could not copy bitmap to parcel blob.

Beta: ti.map-android-5.5.1.zip

       at android.graphics.Bitmap.nativeWriteToParcel(Native Method)
       at android.graphics.Bitmap.writeToParcel(Bitmap.java:2140)
       at com.google.android.gms.internal.maps.zzc.zze(com.google.android.gms:play-services-maps@@18.1.0:3)
       at com.google.android.gms.internal.maps.zzg.zzg(com.google.android.gms:play-services-maps@@18.1.0:2)
       at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromBitmap(com.google.android.gms:play-services-maps@@18.1.0:2)
       at ti.map.AnnotationProxy.handleImage(AnnotationProxy.java:324)
       at ti.map.AnnotationProxy.processOptions(AnnotationProxy.java:270)
       at ti.map.TiUIMapView.addAnnotation(TiUIMapView.java:634)
       at ti.map.ViewProxy.handleAddAnnotation(ViewProxy.java:372)
       at ti.map.ViewProxy.handleAddAnnotations(ViewProxy.java:415)

Fixes: Uncaught Error: Could not copy bitmap to parcel blob.
@hansemannn hansemannn requested a review from m1ga December 14, 2022 22:23
@m1ga
Copy link
Contributor

m1ga commented Dec 15, 2022

Looking good, since the other "Image path" part has the same try/catch it should be fine here too.

But:
since the error is coming from line 324 (

markerOptions.icon(BitmapDescriptorFactory.fromBitmap(bitmap));
) that is already in the try/catch I'm not sure if that fixes the actual issue.

@hansemannn
Copy link
Contributor Author

That was just because I use a different branch (#519) I think :)

@m1ga
Copy link
Contributor

m1ga commented Dec 15, 2022

Ah ok 😄
Ready to merge!

@hansemannn hansemannn merged commit 2f033b3 into tidev:master Dec 15, 2022
@hansemannn hansemannn deleted the fix/guard-blob-processing branch December 15, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants