diff --git a/src/radius/handler/UserPasswordPacketHandler.ts b/src/radius/handler/UserPasswordPacketHandler.ts index e7d4835..9abb4d2 100644 --- a/src/radius/handler/UserPasswordPacketHandler.ts +++ b/src/radius/handler/UserPasswordPacketHandler.ts @@ -16,7 +16,7 @@ export class UserPasswordPacketHandler implements IPacketHandler { const username = packet.attributes['User-Name']; let password = packet.attributes['User-Password']; - if (typeof password !== 'string' && password.indexOf(0x00) > 0) { + if (Buffer.isBuffer(password) && password.indexOf(0x00) > 0) { // check if there is a 0x00 in it, and trim it from there password = password.slice(0, password.indexOf(0x00)); }