fixed NULL in foreach warning

This commit is contained in:
skodak 2006-03-03 22:26:22 +00:00
parent fd5ca378e6
commit 0beabf4898

View File

@ -43,6 +43,9 @@
$var = "restore_user_info_".$modname;
$$var = optional_param( $var,0);
$instances = $info->mods[$mod->name]->instances;
if ($instances === NULL) {
continue;
}
foreach ($instances as $instance) {
$var = 'restore_'.$modname.'_instance_'.$instance->id;
$$var = optional_param($var,0);
@ -82,8 +85,10 @@
$restore->mods[$modname]->restore=$$var;
$var = "restore_user_info_".$modname;
$restore->mods[$modname]->userinfo=$$var;
$instances = $info->mods[$mod->name]->instances;
if ($instances === NULL) {
continue;
}
foreach ($instances as $instance) {
$var = 'restore_'.$modname.'_instance_'.$instance->id;
$restore->mods[$modname]->instances[$instance->id]->restore = $$var;