Fix to for logging switch on browsers having localStorage set to null

applies to e.g. Midori browser on RPi.

Jira-issue: WP-1286