mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Added exception handling if ClassName is null in search results
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114454 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f79c6aeb83
commit
14d4a78d20
@ -823,7 +823,11 @@ class MySQLDatabase extends SS_Database {
|
||||
$records = DB::query($fullQuery);
|
||||
|
||||
foreach($records as $record)
|
||||
$objects[] = new $record['ClassName']($record);
|
||||
if(!$record['ClassName']){
|
||||
throw new Exception("ClassName can not be null, ClassName not set for ". $record['Title']);
|
||||
}else{
|
||||
$objects[] = new $record['ClassName']($record);
|
||||
}
|
||||
|
||||
if(isset($objects)) $doSet = new DataObjectSet($objects);
|
||||
else $doSet = new DataObjectSet();
|
||||
|
Loading…
Reference in New Issue
Block a user