Fixes #770 'lastip' SQL error when no IP is present

#770
Merge pull request #799 from PirataNervo/featurefix-770

Fixes #770 'lastip' SQL error when no IP is present