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 @@ -294,8 +294,16 @@ void user::parse_get_product_list( uint32_t itok )
294294{
295295 add_header ();
296296 jw_.add_key ( " result" , json_wtr::e_arr );
297- for ( unsigned i=0 ; i != sptr_->get_num_product (); ++i ) {
298- product *prod = sptr_->get_product ( i );
297+
298+ // If the primary manager has no products, pull them from the secondary
299+ // manager instead.
300+ pc::manager *mgr = sptr_;
301+ if ( sptr_->get_num_product () == 0 && sptr_->has_secondary () ) {
302+ mgr = sptr_->get_secondary ();
303+ }
304+
305+ for ( unsigned i=0 ; i != mgr->get_num_product (); ++i ) {
306+ product *prod = mgr->get_product ( i );
299307 jw_.add_val ( json_wtr::e_obj );
300308 jw_.add_key ( " account" , *prod->get_account () );
301309 jw_.add_key ( " attr_dict" , json_wtr::e_obj );
You can’t perform that action at this time.
0 commit comments