summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Record.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index 881b8ddb5..c3d783232 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -204,7 +204,10 @@ sub qsearch {
my $dbh = dbh;
my $table = $cache ? $cache->table : $stable;
- my $pkey = $dbdef->table($table)->primary_key;
+ my $dbdef_table = $dbdef->table($table)
+ or die "No schema for table $table found - ".
+ "do you need to create it or run dbdef-create?";
+ my $pkey = $dbdef_table->primary_key;
my @real_fields = grep exists($record->{$_}), real_fields($table);
my @virtual_fields = grep exists($record->{$_}), "FS::$table"->virtual_fields;