Makes the toolbar shadow visible for pre-Lollipop android versions and fixes a crash when deleting a draft with no media attached.

This commit is contained in:
Vavassor 2017-07-15 03:10:55 -04:00
commit f37bb694f1
17 changed files with 190 additions and 203 deletions

View file

@ -131,10 +131,12 @@ public class SavedTootActivity extends BaseActivity implements SavedTootAdapter.
// Delete any media files associated with the status.
ArrayList<String> uris = new Gson().fromJson(item.getUrls(),
new TypeToken<ArrayList<String>>() {}.getType());
for (String uriString : uris) {
Uri uri = Uri.parse(uriString);
if (getContentResolver().delete(uri, null, null) == 0) {
Log.e(TAG, String.format("Did not delete file %s.", uriString));
if (uris != null) {
for (String uriString : uris) {
Uri uri = Uri.parse(uriString);
if (getContentResolver().delete(uri, null, null) == 0) {
Log.e(TAG, String.format("Did not delete file %s.", uriString));
}
}
}
// update DB