diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 3f94ad6ee..6bdeb4d38 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -372,7 +372,10 @@ sub windows_join_data { sub get_win_prodkey { my $osvariant = shift; my $keytab = xCAT::Table->new("prodkey",-create=>0); - my $keyent = $keytab->getAttribs({product=>$osvariant},"key"); + my $keyent; + if ($keytab) { + $keyent = $keytab->getAttribs({product=>$osvariant},"key"); + } if ($keyent) { return "OnError".$keyent->{key}.""; }