diff --git a/library/CM/File.php b/library/CM/File.php
index <HASH>..<HASH> 100644
--- a/library/CM/File.php
+++ b/library/CM/File.php
@@ -45,7 +45,7 @@ class CM_File extends CM_Class_Abstract {
      * @throws CM_Exception
      */
     public function getSize() {
-        $size = filesize($this->getPath());
+        $size = @filesize($this->getPath());
         if (false === $size) {
             throw new CM_Exception('Cannot detect filesize of `' . $this->getPath() . '`');
         }
diff --git a/tests/library/CM/FileTest.php b/tests/library/CM/FileTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/CM/FileTest.php
+++ b/tests/library/CM/FileTest.php
@@ -37,6 +37,21 @@ class CM_FileTest extends CMTest_TestCase {
         }
     }
 
+    public function testGetSize() {
+        $file = CM_File::createTmp(null, 'hello');
+        $this->assertSame(5, $file->getSize());
+    }
+
+    /**
+     * @expectedException CM_Exception
+     * @expectedExceptionMessage Cannot detect filesize
+     */
+    public function testGetSizeInvalid() {
+        $file = CM_File::createTmp(null, 'hello');
+        $file->delete();
+        $file->getSize();
+    }
+
     public function testDelete() {
         $file = new CM_File($this->_testFilePath);
Add test for CM_File::getSize