From f89c732a6b8f42c104da29c8d39795f6e41400dc Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Fri, 29 Apr 2022 22:09:25 -0300 Subject: [PATCH] Fix NPE stringToDate --- src/main/java/com/eu/habbo/Emulator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/eu/habbo/Emulator.java b/src/main/java/com/eu/habbo/Emulator.java index 29fbcbc3..c4e40da9 100644 --- a/src/main/java/com/eu/habbo/Emulator.java +++ b/src/main/java/com/eu/habbo/Emulator.java @@ -443,6 +443,8 @@ public final class Emulator { private static String dateToUnixTimestamp(Date date) { String res = ""; Date aux = stringToDate("1970-01-01 00:00:00"); + if(aux == null) return null; + Timestamp aux1 = dateToTimeStamp(aux); Timestamp aux2 = dateToTimeStamp(date); long difference = aux2.getTime() - aux1.getTime();