Commits

Anonymous committed 320293c

handle null value

Comments (0)

Files changed (1)

storages/backends/ftp.py

         return self._size
 
     def read(self, num_bytes=None):
+        if not num_bytes:
+            return None
+
         if not self._is_read:
             self._storage._start_connection()
             self.file = self._storage._read(self._name)
             self._storage._end_connection()
             self._is_read = True
 
-        if num_bytes:
-            return self.file.read(num_bytes)
-        else:
-            return None
+        return self.file.read(num_bytes)
 
     def write(self, content):
         if 'w' not in self._mode: