Bugsnag crashes when catching App crash before a viewcontrollers are on screen

We've just started using Bugsnag and my colleague noticed that Bugsnag logged an "Exception while creating bugsnag event..." when an error occurs before any viewcontrollers are presented. This pull request checks if there is a viewcontroller before inserting it into the dictionary, so any crashes will be avoided and the issue will be submitted to bugsnag.

Hope you'll pull this in, if there is anything I should change before you can accept it please let me know!