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
Loading
......@@ -44,6 +44,10 @@ public class OTPService {
}
public boolean verifyOTP(String email, String otp) {
if (otp == null) {
throw new NullPointerException("OTP cannot be null");
}
OTPDetails details = otpStorage.get(email);
if (details == null) {
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment