[interchange-cvs] interchange - heins modified lib/Vend/Table/Common.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Sat Oct 6 02:23:01 2001


User:      heins
Date:      2001-10-06 06:22:12 GMT
Modified:  lib/Vend/Table Common.pm
Log:
	* Prevent death when using row_hash in DBM types and non-existent key
	  is hit....will go to stable.

Revision  Changes    Path
2.1       +3 -2      interchange/lib/Vend/Table/Common.pm


rev 2.1, prev_rev 2.0
Index: Common.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.0
retrieving revision 2.1
diff -u -r2.0 -r2.1
--- Common.pm	2001/07/18 02:23:20	2.0
+++ Common.pm	2001/10/06 06:22:12	2.1
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.0 2001/07/18 02:23:20 jon Exp $
+# $Id: Common.pm,v 2.1 2001/10/06 06:22:12 mheins Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -22,7 +22,7 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
 
-$VERSION = substr(q$Revision: 2.0 $, 10);
+$VERSION = substr(q$Revision: 2.1 $, 10);
 use strict;
 
 package Vend::Table::Common;
@@ -247,6 +247,7 @@
 sub row_hash {
     my ($s, $key) = @_;
 	$s = $s->import_db() if ! defined $s->[$TIE_HASH];
+	return undef unless $s->record_exists($key);
 	my %row;
     @row{ @{$s->[$COLUMN_NAMES]} } = $s->row($key);
 	return \%row;