fix a segfault introduced in 8285149b9b1653b22ce1704dd63c7db96ff13089