null workstation sanity checks part 2
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 22:01:29 +0000 (22:01 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 22:01:29 +0000 (22:01 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14876 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js

index 9485d3d..87cacc6 100644 (file)
@@ -316,13 +316,13 @@ function load_item() {
                 network.simple_request('FM_CIRC_CHAIN', [ses(), details.circ.id() ], function(req) { // Tiny race condition between details.circ and circs[circs.length-1] here, but meh :)
                     try {
                         var circs = req.getResultObject();
-                        set("checkout_workstation", typeof circs[0].workstation() == 'object' ? circs[0].workstation().name() : circs[0].workstation() );
+                        set("checkout_workstation", (typeof circs[0].workstation() == 'object' && circs[0].workstation() != null) ? circs[0].workstation().name() : circs[0].workstation() );
                     } catch(E) {
                         alert('Error in alternate_copy_summary.js, FM_CIRC_CHAIN: ' + E);
                     }
                 } );
             } else {
-                set("checkout_workstation", typeof details.circ.workstation() == 'object' ? details.circ.workstation().name() : details.circ.workstation() ); 
+                set("checkout_workstation", (typeof details.circ.workstation() == 'object' && details.circ.workstation() != null) ? details.circ.workstation().name() : details.circ.workstation() );
             }
             set("billings", details.circ.billings()); 
             set("payments", details.circ.payments());