null pointer dereference fix

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>