y can be null, so don't try to use it if it is (bug 1307)