LP#1775466 avoid some quick nav errors
authorBill Erickson <berickxx@gmail.com>
Fri, 1 Jun 2018 20:35:28 +0000 (16:35 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 6 Jun 2018 20:59:42 +0000 (16:59 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts
Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts

index 39369fc..352fd6a 100644 (file)
@@ -110,7 +110,12 @@ export class EgCatalogService {
                 this.getBibSummary(recId, ctx.searchOrg.id(), depth)
                 .then(
                     // idx maintains result sort order
-                    summary => ctx.result.records[idx] = summary
+                    summary => {
+                        if (ctx.result.records) {
+                            // May be reset when quickly navigating results.
+                            ctx.result.records[idx] = summary
+                        }
+                    }
                 )
             );
         });
index 039a065..ad0b2d5 100644 (file)
@@ -67,7 +67,7 @@ export class ResultsComponent implements OnInit {
 
     fleshSearchResults(): void {
         const records = this.searchContext.result.records;
-        if (records.length === 0) { return; }
+        if (!records || records.length === 0) { return; }
 
         // Flesh the creator / editor fields with the user object.
         // Handle the user fleshing here (instead of record.component so