From 178cb187dfc45e4ef2eb5607b156149ded76de57 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Wed, 15 Nov 2006 14:46:16 +0000
Subject: [PATCH] "Fix for getNext/PrevAlphabetically when a fetchRow() returns
 null."

---
 application/models/rows/CourseCode.php | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/application/models/rows/CourseCode.php b/application/models/rows/CourseCode.php
index 08ecfeee..03fc6bd2 100644
--- a/application/models/rows/CourseCode.php
+++ b/application/models/rows/CourseCode.php
@@ -20,7 +20,7 @@ class CourseCode extends Nmc_Db_Table_Row
         $where = implode(' AND ', $where);
 
         $row = $this->_table->fetchRow($where, $order);
-        if($row->getPrimaryKey()) {
+        if($row instanceof Nmc_Db_Table_Row && $row->getPrimaryKey()) {
             return $row;
         }
 
@@ -30,7 +30,7 @@ class CourseCode extends Nmc_Db_Table_Row
         $where = implode(' AND ', $where);
 
         $row = $this->_table->fetchRow($where, $order);
-        if($row->getPrimaryKey()) {
+        if($row instanceof Nmc_Db_Table_Row && $row->getPrimaryKey()) {
             return $row;
         }
 
@@ -39,7 +39,7 @@ class CourseCode extends Nmc_Db_Table_Row
         $where = implode(' AND ', $where);
 
         $row = $this->_table->fetchRow($where, $order);
-        if($row->getPrimaryKey()) {
+        if($row instanceof Nmc_Db_Table_Row && $row->getPrimaryKey()) {
             return $row;
         }
 
@@ -75,7 +75,7 @@ class CourseCode extends Nmc_Db_Table_Row
         $where = implode(' AND ', $where);
 
         $row = $this->_table->fetchRow($where, $order);
-        if($row->getPrimaryKey()) {
+        if($row instanceof Nmc_Db_Table_Row && $row->getPrimaryKey()) {
             return $row;
         }
 
@@ -84,7 +84,7 @@ class CourseCode extends Nmc_Db_Table_Row
         $where = implode(' AND ', $where);
 
         $row = $this->_table->fetchRow($where, $order);
-        if($row->getPrimaryKey()) {
+        if($row instanceof Nmc_Db_Table_Row && $row->getPrimaryKey()) {
             return $row;
         }
 
-- 
GitLab