Incorrect use of DataObject type matching after ->find()

This commit is contained in:
Mikael Nordfeldth 2015-09-04 20:35:11 +02:00
parent 57c87088d4
commit 1e07f8c045

View File

@ -110,8 +110,7 @@ class Conversation extends Managed_DataObject
{ {
$conv = new Conversation(); $conv = new Conversation();
$conv->id = $notice->conversation; $conv->id = $notice->conversation;
$conv->find(true); if (!$conv->find(true)) {
if (!$conv instanceof Conversation) {
common_debug('Conversation does not exist for notice ID: '.$notice->id); common_debug('Conversation does not exist for notice ID: '.$notice->id);
throw new NoResultException($conv); throw new NoResultException($conv);
} }