Fix NPE
This commit is contained in:
parent
e46e4c37f9
commit
c571408815
2 changed files with 3 additions and 4 deletions
|
@ -108,7 +108,7 @@ public class ImportHelper {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleFavouritesImport(Uri uri) {
|
public void handleFavouritesImport(@NonNull Uri uri) {
|
||||||
String scheme = uri.getScheme();
|
String scheme = uri.getScheme();
|
||||||
boolean isFileIntent = "file".equals(scheme);
|
boolean isFileIntent = "file".equals(scheme);
|
||||||
boolean isContentIntent = "content".equals(scheme);
|
boolean isContentIntent = "content".equals(scheme);
|
||||||
|
|
|
@ -141,9 +141,8 @@ public class FavoritesActivity extends TabActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (requestCode == IMPORT_FAVOURITES_REQUEST && resultCode == Activity.RESULT_OK) {
|
} else if (requestCode == IMPORT_FAVOURITES_REQUEST && resultCode == Activity.RESULT_OK) {
|
||||||
if (data != null) {
|
if (data != null && data.getData() != null) {
|
||||||
Uri uri = data.getData();
|
importHelper.handleFavouritesImport(data.getData());
|
||||||
importHelper.handleFavouritesImport(uri);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
Loading…
Reference in a new issue