diff --git a/calendar.module b/calendar.module
index 354665e..3067efd 100644
--- a/calendar.module
+++ b/calendar.module
@@ -526,7 +526,7 @@ function calendar_granularity_path(&$view, $granularity) {
           }
         }
 
-        if ($type == $granularity) {
+        if (isset($type) && ($type == $granularity)) {
           $part_path =  $display->display_options['path'];
           $parts = explode('/', $part_path);
           if (in_array('%', $parts)) {
