Index: realname.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/realname/realname.module,v
retrieving revision 1.4.4.59
diff -u -r1.4.4.59 realname.module
--- realname.module	26 May 2010 21:10:01 -0000	1.4.4.59
+++ realname.module	6 Oct 2010 02:20:28 -0000
@@ -353,8 +353,9 @@
 
     $theme_registry['user_picture']['theme path'] = $path;
     $theme_registry['user_picture']['theme paths'][0] = $path;
-    foreach ($theme_registry['user_picture']['preprocess functions'] as $key => $value) {
-      if ($value == 'template_preprocess_user_picture') {
+    if (!empty($theme_registry['user_picture']['preprocess functions'])) {
+      $key = array_search($theme_registry['user_picture']['preprocess functions'], 'template_preprocess_user_picture');
+      if ($key !== FALSE) {
         $theme_registry['user_picture']['preprocess functions'][$key] = 'template_preprocess_user_picture_realname';
       }
     }
