Before this change, we uses an unguarded type assertion which failed when NewObject returned a google document instead of an Object. This change uses the ID() method to read the id which works for all types of file instead and returns a sensible error if one isn't found. Fixes #8990