forked from j62/ctbrec
1
0
Fork 0

Fix possible IndexOutOfBoundsException in the follow animation

This commit is contained in:
0xboobface 2018-12-13 02:35:03 +01:00
parent 168ad694ae
commit 9f287b6d81
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ public class SiteUiFactory {
private static ChaturbateSiteUi ctbSiteUi;
private static MyFreeCamsSiteUi mfcSiteUi;
public static SiteUI getUi(Site site) {
public static synchronized SiteUI getUi(Site site) {
if (site instanceof BongaCams) {
if (bongaSiteUi == null) {
bongaSiteUi = new BongaCamsSiteUi((BongaCams) site);

View File

@ -617,7 +617,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
private double getFollowedTabYPosition(Tab followedTab) {
TabPane tabPane = getTabPane();
int idx = tabPane.getTabs().indexOf(followedTab);
int idx = Math.max(0, tabPane.getTabs().indexOf(followedTab));
for (Node node : tabPane.getChildrenUnmodifiable()) {
Parent p = (Parent) node;
for (Node child : p.getChildrenUnmodifiable()) {