$cordovaDevice.getDevice() when undefined

With the code I was looking at in ng-cordova.js, when I call $cordovaDevice.getDevice() and device is undefined it throws because it just tries to return device. I was trying to simply replace my previous

if typeof device == "undefined"

with

if typeof $cordovaDevice.getDevice() == "undefined"

I think that code for $cordovaDevice.getDevice() should probably be more like:

  getDevice: function () {
    return typeof(device) == "undefined" ? undefined : device;
  },

Thanks