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 WebViewer crash on old Android due to NPE #2304

Merged
merged 1 commit into from Oct 8, 2020

Conversation

ewpatton
Copy link
Member

@ewpatton ewpatton commented Sep 4, 2020

The ability to reference assets using http://localhost/ as an
authority fail on older versions of Android due to a
NullPointerException caused by the MIME type lookup returning null
rather than a valid MIME type. This can happen even for common file
types like JavaScript files. Newer versions of Android have a more
complete MIME type table and don't exhibit this issue.

Change-Id: I3f1b3846262f0c1613ad7807c1758a7d24fb246d

The ability to reference assets using http://localhost/ as an
authority fail on older versions of Android due to a
NullPointerException caused by the MIME type lookup returning null
rather than a valid MIME type. This can happen even for common file
types like JavaScript files. Newer versions of Android have a more
complete MIME type table and don't exhibit this issue.

Change-Id: I3f1b3846262f0c1613ad7807c1758a7d24fb246d
@ewpatton
Copy link
Member Author

ewpatton commented Sep 4, 2020

@ewpatton
Copy link
Member Author

ewpatton commented Sep 4, 2020

I tested on SDK 21 (5.0 Lollipop), SDK 14 (4.0 Ice Cream Sandwich) and SDK 11 (Honeycomb). All but the last worked, and the latter loaded but crashed when attempting to show the alert dialog deep within the Android code. My guess is that this has something to do with themes and nothing to do with the WebViewer logic (our code isn't anywhere in the stack trace). Given that most Honeycomb devices likely would have had an upgrade path to ICS, I'm willing to overlook that.

@jisqyv jisqyv self-assigned this Oct 8, 2020
@jisqyv jisqyv merged commit 5733f1d into mit-cml:ucr Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants