bmf: do not dereference NULL pointer