Guard kasfShipsCount() from NULL arguments.

Check the selection pointer for NULL before dereferencing it.