diff --git a/core/setup/controller.php b/core/setup/controller.php
index 9b35432f11306fe3b2f44093e70c35638c05a149..679efee81bf5004807b670d3e3987b754f009d82 100644
--- a/core/setup/controller.php
+++ b/core/setup/controller.php
@@ -70,7 +70,6 @@ class Controller {
 
 		// Protect data directory here, so we can test if the protection is working
 		\OC_Setup::protectDataDirectory();
-		$htaccessWorking = false;
 		try {
 			$htaccessWorking = \OC_Util::isHtAccessWorking();
 		} catch (\OC\HintException $e) {
@@ -78,6 +77,7 @@ class Controller {
 				'error' => $e->getMessage(),
 				'hint' => $e->getHint()
 			);
+			$htaccessWorking = false;
 		}
 
 		return array(