Index: xmlsitemap_node/xmlsitemap_node.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module,v
retrieving revision 1.19.2.20.2.73
diff -u -p -r1.19.2.20.2.73 xmlsitemap_node.module
--- xmlsitemap_node/xmlsitemap_node.module	20 Dec 2009 01:56:02 -0000	1.19.2.20.2.73
+++ xmlsitemap_node/xmlsitemap_node.module	21 Dec 2009 21:50:55 -0000
@@ -257,22 +257,31 @@ function xmlsitemap_node_content_extra_f
  * Fetch all the timestamps for when a node was changed.
  *
  * @param $node
- *   A node object.
+ *   A node object or the nid itself.
  * @return
  *   An array of UNIX timestamp integers.
  */
 function xmlsitemap_node_get_timestamps($node) {
   static $timestamps = array();
 
-  if (!isset($timestamps[$node->nid])) {
-    $timestamps[$node->nid] = array();
-    $query = db_query("SELECT c.timestamp FROM {comments} c WHERE c.nid = %d AND c.status = %d UNION ALL SELECT nr.timestamp FROM {node_revisions} nr WHERE nr.nid = %d", $node->nid, COMMENT_PUBLISHED, $node->nid);
+  // If a number was submitted just use it.
+  if (is_numeric($node)) {
+    $nid = $node;
+  }
+  // Otherwise assume the full node object was passed in.
+  else {
+    $nid = $node->nid;
+  }
+
+  if (!isset($timestamps[$nid])) {
+    $timestamps[$nid] = array();
+    $query = db_query("SELECT c.timestamp FROM {comments} c WHERE c.nid = %d AND c.status = %d UNION ALL SELECT nr.timestamp FROM {node_revisions} nr WHERE nr.nid = %d", $nid, COMMENT_PUBLISHED, $nid);
     while ($timestamp = db_result($query)) {
-      $timestamps[$node->nid][] = (int) $timestamp;
+      $timestamps[$nid][] = (int) $timestamp;
     }
   }
 
-  return $timestamps[$node->nid];
+  return $timestamps[$nid];
 }
 
 /**
