wstrange / GoogleAuth

Google Authenticator Server side code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not setting scratch codes to GoogleAuthenticatorKey builder throws NPE

jasonab opened this issue · comments

When using the builder for GoogleAuthenticatorKey, the scratch codes are passed into the ArrayList constructor:
this.scratchCodes = new ArrayList<>(scratchCodes);

However, if the scratch codes were not set in the builder, the ArrayList constructor throws NullPointerException on this line. If the scratch codes are required, I would suggest that the builder initialize the value to an empty list.

Very true. Fixed in 1.1.5.