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

NullPointerException: Attempt to invoke virtual method 'java.lang.String org.wordpress.android.fluxc.model.SiteModel.ge... #12341

Closed
oguzkocer opened this issue Jul 3, 2020 · 7 comments

Comments

@oguzkocer
Copy link
Contributor

A single user is having this issue, so maybe it'd be a good win during Groundskeeping considering it should be easy to fix 🤞

Sentry Url: https://sentry.io/share/issue/57de38ddfcb346f6b4b9fde615966757/
User Count: 1
Count: 11
First Release: [email protected]+885
First Seen: 2020-07-01T08:54:54.819000Z
Last Seen: 2020-07-01T09:13:22Z
24 Hours: 0
30 Days: 11

NullPointerException: Attempt to invoke virtual method 'java.lang.String org.wordpress.android.fluxc.model.SiteModel.getUrl()' on a null object reference
     at org.wordpress.android.ui.uploads.UploadService.updatePostWithMediaUrl(UploadService.java:612)
     at org.wordpress.android.ui.uploads.UploadService.updatePostWithCurrentlyCompletedUploads(UploadService.java:459)
     at org.wordpress.android.ui.uploads.UploadService.updateOnePostModelWithCompletedAndFailedUploads(UploadService.java:707)
     at org.wordpress.android.ui.uploads.UploadService.doFinalProcessingOfPosts(UploadService.java:993)
     at org.wordpress.android.ui.uploads.UploadService.stopServiceIfUploadsComplete(UploadService.java:670)
     at org.wordpress.android.ui.uploads.UploadService.onPostUploaded(UploadService.java:1082)
...
(6 additional frame(s) were not displayed)
@bummytime
Copy link
Member

Agree with @oguzkocer here — adding to Groundskeeping.

@designsimply
Copy link
Contributor

Events in the last 90d: 82
Users affected in the last 90d: 11
WORDPRESS-ANDROID-F7H: https://sentry.io/share/issue/57de38ddfcb346f6b4b9fde615966757/

image

@designsimply
Copy link
Contributor

Events in the last 90d: 121
Users affected in the last 90d: 18
WORDPRESS-ANDROID-F7H: https://sentry.io/share/issue/57de38ddfcb346f6b4b9fde615966757/

image

@designsimply
Copy link
Contributor

Number of occurrences are still very low but I'm leaving this open because of the note about it being a potentially easy fix.

@designsimply
Copy link
Contributor

Events in the last 90d: 310
Users affected in the last 90d: 15
WORDPRESS-ANDROID-F7H: https://sentry.io/share/issue/57de38ddfcb346f6b4b9fde615966757/

image

I think this one's worth keeping open a little longer to see if we can get it fixed because it's related to media uploads which is an important part of the app.

@designsimply
Copy link
Contributor

Numbers still fairly low but the comment about media still stands.

image

@mzorz
Copy link
Contributor

mzorz commented Mar 29, 2021

This is interesting! This crash was happening here:

            // actually replace the media ID with the media uri
            processor.replaceMediaFileWithUrlInPost(post, String.valueOf(media.getId()),
                    FluxCUtils.mediaFileFromMediaModel(media), site.getUrl());

This one was still like this in 16.8.1

But it was changed recently as part of this PR here #14191

With those changes, the offending call to site.getUrl() has now been removed and the SiteModel instance is passed down to the processor with the @Nullable annotation, and it is then checked for nullity safely here:

String siteUrl = site != null ? site.getUrl() : "";

Checked Sentry and found there's no reports for version 16.9, where the changes in #14191 were shipped.

With that, I think this issue should be now fixed by these changes, so we can close this one 👍

@mzorz mzorz closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants