Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit e798df54 authored by Darrel Danadyaksa Poli's avatar Darrel Danadyaksa Poli
Browse files

[REFACTOR] Add null check for OTP parameter in verifyOTP method

parent 0b8be478
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,10 @@ public class OTPService { ...@@ -44,6 +44,10 @@ public class OTPService {
} }
public boolean verifyOTP(String email, String otp) { public boolean verifyOTP(String email, String otp) {
if (otp == null) {
throw new NullPointerException("OTP cannot be null");
}
OTPDetails details = otpStorage.get(email); OTPDetails details = otpStorage.get(email);
if (details == null) { if (details == null) {
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment