diff --git a/filesystem/Filesystem.php b/filesystem/Filesystem.php
index <HASH>..<HASH> 100644
--- a/filesystem/Filesystem.php
+++ b/filesystem/Filesystem.php
@@ -152,7 +152,7 @@ class Filesystem extends Object {
 		// Update the image tracking of all pages
 		if($syncLinkTracking) {
 			if(class_exists('SiteTree')) {
-				$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
+				if(class_exists('Subsite')) $origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
 				if(class_exists('Subsite')) Subsite::$disable_subsite_filter = true;
 				foreach(DataObject::get("SiteTree") as $page) {
 					// syncLinkTracking is called by SiteTree::onBeforeWrite().
BUGFIX Checking for existence of Subsite correctly in Filesystem::sync()