File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -298,8 +298,16 @@ void user::parse_get_product_list( uint32_t itok )
298298{
299299 add_header ();
300300 jw_.add_key ( " result" , json_wtr::e_arr );
301- for ( unsigned i=0 ; i != sptr_->get_num_product (); ++i ) {
302- product *prod = sptr_->get_product ( i );
301+
302+ // If the primary manager has no products, pull them from the secondary
303+ // manager instead.
304+ pc::manager *mgr = sptr_;
305+ if ( sptr_->get_num_product () == 0 && sptr_->has_secondary () ) {
306+ mgr = sptr_->get_secondary ();
307+ }
308+
309+ for ( unsigned i=0 ; i != mgr->get_num_product (); ++i ) {
310+ product *prod = mgr->get_product ( i );
303311 jw_.add_val ( json_wtr::e_obj );
304312 jw_.add_key ( " account" , *prod->get_account () );
305313 jw_.add_key ( " attr_dict" , json_wtr::e_obj );
You can’t perform that action at this time.
0 commit comments