fix pages with events < maxevents
This commit is contained in:
parent
3ba50f3df7
commit
fea21a4c82
|
@ -74,11 +74,19 @@ public class FbPageScraper extends AsyncTask<Void, Void, Void> {
|
||||||
int max = shared_prefs.getInt("page_event_max", 5);
|
int max = shared_prefs.getInt("page_event_max", 5);
|
||||||
|
|
||||||
if (event_links.size() < max) {
|
if (event_links.size() < max) {
|
||||||
String next_url = document
|
|
||||||
.getElementsByAttributeValueMatching("href", "has_more=1")
|
|
||||||
.first().attr("href");
|
|
||||||
|
|
||||||
this.url = "https://mbasic.facebook.com" + next_url;
|
try {
|
||||||
|
String next_url = document
|
||||||
|
.getElementsByAttributeValueMatching("href", "has_more=1")
|
||||||
|
.first().attr("href");
|
||||||
|
|
||||||
|
this.url = "https://mbasic.facebook.com" + next_url;
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
url = null;
|
||||||
|
event_links = event_links.subList(0, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
url = null;
|
url = null;
|
||||||
event_links = event_links.subList(0, max);
|
event_links = event_links.subList(0, max);
|
||||||
|
|
Loading…
Reference in New Issue