Good catch, I believe it should check for a non-null wallet.