Fix failed chr save due to null jail expiration

This commit is contained in:
P0nk
2024-09-26 07:54:04 +02:00
parent 1d5c26e67c
commit bf9c02bc16
2 changed files with 3 additions and 3 deletions

View File

@@ -8487,7 +8487,7 @@ public class Character extends AbstractCharacterObject {
ps.setInt(46, stats.omokLosses());
ps.setInt(47, stats.omokTies());
ps.setString(48, stats.dataString());
ps.setLong(49, stats.jailExpiration());
ps.setLong(49, Objects.requireNonNullElse(stats.jailExpiration(), 0L));
ps.setInt(50, Objects.requireNonNullElse(stats.partnerId(), -1));
ps.setInt(51, Objects.requireNonNullElse(stats.marriageItemId(), -1));
ps.setTimestamp(52, new Timestamp(stats.lastExpGainTime()));

View File

@@ -127,8 +127,8 @@ public class CharacterRepository {
.bind("ariant_points", stats.ariantPoints())
.bind("data_string", stats.dataString())
.bind("party_search", stats.canRecvPartySearchInvite())
.bind("jail_expire", new Timestamp(stats.jailExpiration()))
.bind("last_exp_gain", new Timestamp(stats.lastExpGainTime()))
.bind("jail_expire", stats.jailExpiration() != null ? new Timestamp(stats.jailExpiration()) : null)
.bind("last_exp_gain", stats.lastExpGainTime() != null ? new Timestamp(stats.lastExpGainTime()) : null)
.bind("partner_id", stats.partnerId())
.bind("marriage_item_id", stats.marriageItemId())
.bind("id", stats.id())