Don't crash when loading images without internet permission (#5745)

Catch SecurityException when unblocking network load
This commit is contained in:
Dimitri Wauters 2021-10-26 18:15:56 +02:00 committed by GitHub
parent a951e07fed
commit c6af46ce58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,11 @@ public class MessageWebView extends WebView {
* will network images that are already in the WebView cache.
*
*/
getSettings().setBlockNetworkLoads(shouldBlockNetworkData);
try {
getSettings().setBlockNetworkLoads(shouldBlockNetworkData);
} catch (SecurityException e) {
Timber.e(e, "Failed to unblock network loads. Missing INTERNET permission?");
}
}