fix segfault in DEBUG mode

The essid may be null