avoid double check `!isBuffer`

Hi,
if you want to use `var buf`, are you free to close this PR :)