Fixed issue with relaunching app after backgrounding

onNewIntent() can be called with no query, in that case don't try
querying.