]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix E_NOTICE from attempt to access undefined array key
authorZach Copley <zach@status.net>
Thu, 8 Sep 2011 04:45:49 +0000 (21:45 -0700)
committerZach Copley <zach@status.net>
Thu, 8 Sep 2011 04:45:49 +0000 (21:45 -0700)
classes/Managed_DataObject.php

index 552d980fba172b362f4d06b67420cb411960d2bc..106065fc46673c67181321da644fe2dae781dab1 100644 (file)
@@ -161,7 +161,9 @@ abstract class Managed_DataObject extends Memcached_DataObject
 
         foreach ($table['foreign keys'] as $keyname => $keydef) {
             if (count($keydef) == 2 && is_string($keydef[0]) && is_array($keydef[1]) && count($keydef[1]) == 1) {
-                $links[$keydef[1][0]] = $keydef[0].':'.$keydef[1][1];
+                if (isset($keydef[1][0])) {
+                    $links[$keydef[1][0]] = $keydef[0].':'.$keydef[1][1];
+                }
             }
         }
         return $links;