Bugfix for FS#1318

This fixes Flyspray #1318, which was introduced last year by commit 

https://github.com/OpenCPN/OpenCPN/commit/4c6df0ca247eb8b9695378be76afaa9fc907f036

Thomas