Fix error on setup of new app

`result` can be nil if the app has no refs pushed to it yet.