Index: dropbox.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dropbox/dropbox.module,v
retrieving revision 1.4
diff -u -r1.4 dropbox.module
--- dropbox.module	20 Jul 2009 01:17:54 -0000	1.4
+++ dropbox.module	20 Jul 2009 02:46:47 -0000
@@ -299,7 +299,7 @@
   global $user;
   $destination_user = $form_state['values']['destination_user'];
   $file = file_save_upload('upload', array());
-  if ($file != 0) {
+  if (is_object($file)) {
     $error = dropbox_file_put($destination_user, $file, '/' . variable_get('site_name', 'Drupal') . '/' . strtr($form_state['values']['mail'], "@", "-"));
     if (!$error) {
       $params = array();
@@ -308,7 +308,7 @@
       $params['mail'] = strtr($form_state['values']['mail'], "@", "-");
       drupal_mail('dropbox', 'send_notify', $destination_user->name . ' <' . $destination_user->mail . '>', user_preferred_language($destination_user), $params, $form_state['values']['mail']);
       drupal_set_message(t('%filename has successfully been sent.', array('%filename' => $file->filename)));
-      watchdog('dropbox', t("%from sent a file to %to's Dropbox account.", array('%from' => $user->name, '%to' => $destination_user->name)));
+      watchdog('dropbox', t("%from sent a file to %to's Dropbox account.", array('%from' => isset($user->name) ? $user->name : $params['name'], '%to' => $destination_user->name)));
       file_delete($file->filepath);
     }
     else {
