Fix NPE on wifi connect

For some weird reason database is not opened and when wifi connection is established SLS crashes because mDb is null, adding this little check solves it.
Merge pull request #1 from luisbandalap/patch-1

Fix NPE on wifi connect