sig: fix bad signature exception

Due to the previous change, a bad signature will raise a generic error
because `constant-string=` doesn't handle `nil`. We test if we have a
signature before checking the signature. If the signature is nil, the
appropriate error code is presented to the user.