There should always be at least one Device record--the locally installed one.  If it doesn't exist, then ... well... we're screwed :)  But, our best chance to recover is to add our own Device object (which should be happening in the install, anyway).

Note that this code didn't change--I simply put this code in a conditional statement.  Now, I only run this code if we haven't already verified that the "own device" object exists already, and have a cached pointer to it.