Fix oopsie

This commit is contained in:
theanonymousexyz 2022-04-23 22:17:10 +02:00
parent 2934d726f2
commit e1f05aa2a5
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB

View file

@ -789,8 +789,10 @@ public class ResponseHelper {
if (user != null) { if (user != null) {
try (Session s = DatabaseSessionFactory.createSession()) { try (Session s = DatabaseSessionFactory.createSession()) {
if (user.getSubscribed().contains(channelId)) { if (user.getSubscribed().contains(channelId)) {
Set<String> subscribed = user.getSubscribed();
subscribed.removeIf(sub -> sub.equals(channelId));
user.setSubscribed(subscribed);
user.getSubscribed().removeIf(sub -> sub.equals(channelId));
s.update(user); s.update(user);
s.getTransaction().begin(); s.getTransaction().begin();
s.getTransaction().commit(); s.getTransaction().commit();