Equal to length for index is out of bounds as well

Stephen Paul Weber created

Change summary

src/main/java/eu/siacs/conversations/entities/Conversation.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/entities/Conversation.java 🔗

@@ -1945,7 +1945,7 @@ public class Conversation extends AbstractEntity
                 return pg2;
             }
 
-            if (position-2 > sessions.size()) return null;
+            if (position-2 >= sessions.size()) return null;
             ConversationPage session = sessions.get(position-2);
             View v = session.inflateUi(container.getContext(), (s) -> removeSession(s));
             if (v != null && v.getParent() != null) {