From 638905c270824b3c0e673ae9872937c06fbd862e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 25 Jun 2009 11:10:34 -0700 Subject: avoid getting duplicate errors on upload --- classes/File.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'classes/File.php') diff --git a/classes/File.php b/classes/File.php index b98c9e665..5dd7cd865 100644 --- a/classes/File.php +++ b/classes/File.php @@ -91,9 +91,10 @@ class File extends Memcached_DataObject $given_url = File_redirection::_canonUrl($given_url); if (empty($given_url)) return -1; // error, no url to process $file = File::staticGet('url', $given_url); - if (empty($file->id)) { + if (empty($file)) { $file_redir = File_redirection::staticGet('url', $given_url); - if (empty($file_redir->id)) { + if (empty($file_redir)) { + common_debug("processNew() '$given_url' not a known redirect.\n"); $redir_data = File_redirection::where($given_url); $redir_url = $redir_data['url']; if ($redir_url === $given_url) { -- cgit v1.2.3-54-g00ecf