--- nodecomment.module.org	2010-07-19 16:23:03.000000000 +0200
+++ nodecomment.module	2010-11-22 13:26:00.000000000 +0100
@@ -88,13 +88,20 @@ function nodecomment_preprocess_node(&$v
     // Add node-comment-$type after node-comment AND the specific node type.
     array_splice($vars['template_files'], 1, 0, 'node-comment-'. $node->type);
 
-    if (isset($node->view) && ($cache = $node->view->display_handler->get_cache_plugin()) && get_class($cache) != 'views_plugin_cache_none') {
-      // Caching is enabled, so use tokens instead of real values.
-      $vars['new'] = '';
-      $vars['first_new'] = "<!--post:first-new-$node->nid-->";
-      $vars['new_output'] = "<!--post:new-$node->nid-->";
-      $vars['new_class'] = "<!--post:new-class-$node->nid-->";
-      $vars['classes'] = (isset($vars['classes']) ? $vars['classes'] . ' ' : '') . $vars['new_class'];
+    if (isset($node->view)) {
+      if (views_api_version() == 3) {
+        $cache = $node->view->display_handler->get_plugin('cache');
+      } else {
+        $cache = $node->view->display_handler->get_cache_plugin();
+      }    
+      if ($cache && get_class($cache) != 'views_plugin_cache_none') {
+        // Caching is enabled, so use tokens instead of real values.
+        $vars['new'] = '';
+        $vars['first_new'] = "<!--post:first-new-$node->nid-->";
+        $vars['new_output'] = "<!--post:new-$node->nid-->";
+        $vars['new_class'] = "<!--post:new-class-$node->nid-->";
+        $vars['classes'] = (isset($vars['classes']) ? $vars['classes'] . ' ' : '') . $vars['new_class'];
+      }
     }
     else {
       // First comment checking.
