Fixed a null-pointer dereference pointed out by Olivier Thauvin.