diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php
index 3025d36a2103d705943c1347df551eaf3788122a..64b6a086271daa81284fb855f7d3514a787f877e 100644
--- a/apps/files_trashbin/lib/Storage.php
+++ b/apps/files_trashbin/lib/Storage.php
@@ -268,7 +268,7 @@ class Storage extends Wrapper {
 	 */
 	private function doDelete($path, $method, $ownerOnly = false) {
 		if (self::$disableTrash
-			|| !\OC_App::isEnabled('files_trashbin')
+			|| !\OC::$server->getAppManager()->isEnabledForUser('files_trashbin')
 			|| (pathinfo($path, PATHINFO_EXTENSION) === 'part')
 			|| $this->shouldMoveToTrash($path) === false
 		) {