treat null result as an empty list
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jan 2009 18:03:40 +0000 (18:03 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Jan 2009 18:03:40 +0000 (18:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11846 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_result.js

index 0a24859..44ba0a0 100644 (file)
@@ -197,7 +197,8 @@ patron.search_result.prototype = {
                        if (obj.search_term_count > 0) {
                                //alert('search params = ' + obj.error.pretty_print( js2JSON( params ) ) );
                                results = this.network.simple_request( 'FM_AU_IDS_RETRIEVE_VIA_HASH', params );
-                               if ( (results == null) || (typeof results.ilsevent != 'undefined') ) throw(results);
+                if ( results == null ) results = [];
+                               if (typeof results.ilsevent != 'undefined') throw(results);
                                if (results.length == 0) {
                                        alert($("patronStrings").getString('staff.patron.search_result.search.no_patrons_found'));
                                        return;