title: Cannot find function getName in object function getContinuationToken()
body: <p>I inherited some code for a Google document sharing site. Google sunsetted the docslist class and I converted over to driveapp. The following function checks if any files are added. I have a basic understanding of the code and do not understand what is causing the error. </p>
  
  <p>The following function does not work. Cannot find function getName in object function getContinuationToken()</p>
  
  <p>Here is the function:</p>
  
  <pre><code>function checkDocs(){
  
    try {
  var pageFolder = DriveApp.getFolderById('0B3e2-xxxxxxxxxxxxxxxxx');
  var filesAdded = new Array();
  var counter = 0;
  var pageFiles = pageFolder.getFiles();
  var blank = new Array(); //extra for function
  var type = "FILE";
  
    // Logger.log(pageFiles)
  
  for (var i = 0; i &lt; pageFiles.length; i++) {
    if (!inProperties(pageFiles[i].getName(), pageFiles[i].getFileType().toString(), type)) {
      filesAdded[counter] = pageFiles[i];
      counter++;
    }
  }
  
  if (filesAdded.length &gt; 0) {  
    thereAreUpdates = true;
    docWasAdded = true;
    additioned(filesAdded, blank, type);
  }
  
  deletedDocs = checkDeleted(pageFiles);
  if (deletedDocs.length &gt; 0) {
   thereAreUpdates = true;
   docWasRemoved = true;
     }
  
    } catch (e) {
    MailApp.sendEmail("xxxx@xxxxx.com", "Doc Share Error - Doc", e.message);
    }
  }
  </code></pre>
  
  <p>The function inProperties is this</p>
  
  <pre><code>//checking to see if the file or link is in the database
  function inProperties(first,second,type) { //file: name,type ... link: name,link
  
    var keys = PropertiesService.getScriptProperties().getKeys(); 
    var exists = false;
  
    if (keys.length &gt; 0) {
  if (type == "FILE") {
    for (i in keys) {
      if (keys[i] == (second + " - " + first)) {
        exists = true;
      }
    }
  }
  if (type == "LINK") {
    for (i in keys) {
      if (keys[i] == ("link - " + second)) {
        exists = true;
      }
    }
  }
    }
  
    if (exists) {
  return true;
    } else {
    addition(first,second,type);
    return false;
    }
  }
  </code></pre>
  
  <p>Thanks very much I changed the code and now it gets farther but still has an error. </p>
  
  <p>When debugging it gets to the filesAdded line and then goes right to catch. The debugger shows filesAdded []  counter = 0.0 and I don't see a value for i. There are correct values for thisFileName, thisFileType and Type.</p>
  
  <pre><code>if (!inProperties(thisFileName, thisFileType, type)) {
    filesAdded[counter] = pageFiles[i];
    counter++;
  </code></pre>