🆙 Fix Null error in SubscriptionHabboClub
This commit is contained in:
parent
f0be6533f0
commit
3a33720124
@ -265,9 +265,15 @@ public class SubscriptionHabboClub extends Subscription {
|
||||
|
||||
try (ResultSet set = statement.executeQuery()) {
|
||||
while (set.next()) {
|
||||
try {
|
||||
int userId = set.getInt("user_id");
|
||||
try {
|
||||
HabboInfo habboInfo = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
||||
|
||||
if (habboInfo == null) {
|
||||
SubscriptionManager.LOGGER.error("HabboInfo is null for user #" + userId);
|
||||
continue;
|
||||
}
|
||||
|
||||
HabboStats stats = habboInfo.getHabboStats();
|
||||
ClubCenterDataComposer calculated = calculatePayday(habboInfo);
|
||||
int totalReward = (calculated.creditRewardForMonthlySpent + calculated.creditRewardForStreakBonus);
|
||||
@ -279,7 +285,7 @@ public class SubscriptionHabboClub extends Subscription {
|
||||
stats.lastHCPayday = timestampNow;
|
||||
Emulator.getThreading().run(stats);
|
||||
} catch (Exception e) {
|
||||
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e);
|
||||
SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + userId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -308,6 +314,7 @@ public class SubscriptionHabboClub extends Subscription {
|
||||
isExecuting = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a user logs in. Checks for any unclaimed HC Pay day rewards and issues rewards.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user