petrsnd / OtpCore

HOTP and TOTP utilities for one-time password algorithm implementation
MIT License
6 stars 1 forks source link

Malformed URI throws Null Reference Exception #22

Closed aamburn closed 1 year ago

aamburn commented 1 year ago

This throws a null reference exception:

var uri = "otpauth://totp/Test?&issuer=Test"; var totp = OtpCoreTotp.GetAuthenticator(uri);

Stacktrace:

Object reference not set to an instance of an object. at Petrsnd.OtpCore.OtpAuthUri..ctor(Uri uri) in ..\OtpCore\OtpCore\OtpAuthUri.cs:line 104 at Petrsnd.OtpCore.Totp.GetAuthenticator(Uri uri) in ..\OtpCore\OtpCore\Totp.cs:line 62 at Petrsnd.OtpCore.Totp.GetAuthenticator(String uriString) in ..\OtpCore\OtpCore\Totp.cs:line 57

petrsnd commented 1 year ago

Fixed by #23