Prevent Warning: Invalid argument supplied for foreach() in system.c

Prevent Warning: Invalid argument supplied for foreach() in system.c
when no captive portal is specified