check if MONGO_URI is None before trying to parse it

This was a little issue I ran into in another project and while I fixed it in a separate manner I figured I'd see if you were interested in fixing it this way as well.