mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 12:22:08 +01:00
Add try-catch to followed tags obtaining
Just in case.
This commit is contained in:
parent
0072f22845
commit
568d542df5
1 changed files with 8 additions and 6 deletions
|
@ -91,12 +91,14 @@ public class Helpers {
|
||||||
" if (typeof gon !== 'undefined' && typeof gon.user !== 'undefined') {" +
|
" if (typeof gon !== 'undefined' && typeof gon.user !== 'undefined') {" +
|
||||||
" var followed_tags = document.getElementById(\"followed_tags\");" +
|
" var followed_tags = document.getElementById(\"followed_tags\");" +
|
||||||
" if(followed_tags != null) {" +
|
" if(followed_tags != null) {" +
|
||||||
" var links = followed_tags.nextElementSibling.children[0].children;" +
|
" try {" +
|
||||||
" var tags = [];" +
|
" var links = followed_tags.nextElementSibling.children[0].children;" +
|
||||||
" for(var i = 0; i < links.length - 1; i++) {" + // the last element is "Manage followed tags" link
|
" var tags = [];" +
|
||||||
" tags.push(links[i].innerText.substring(1));" +
|
" for(var i = 0; i < links.length - 1; i++) {" + // the last element is "Manage followed tags" link
|
||||||
" }" +
|
" tags.push(links[i].innerText.substring(1));" +
|
||||||
" gon.user[\"android_app.followed_tags\"] = tags;" +
|
" }" +
|
||||||
|
" gon.user[\"android_app.followed_tags\"] = tags;" +
|
||||||
|
" } catch(e) {}" +
|
||||||
" }" +
|
" }" +
|
||||||
" var userProfile = JSON.stringify(gon.user);" +
|
" var userProfile = JSON.stringify(gon.user);" +
|
||||||
" AndroidBridge.setUserProfile(userProfile.toString());" +
|
" AndroidBridge.setUserProfile(userProfile.toString());" +
|
||||||
|
|
Loading…
Reference in a new issue