Skip to content

Commit 5cc93fb

Browse files
committed
fixes for failing tests
1 parent 13beeb4 commit 5cc93fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/services/partners/family_request_create_service.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ def item_requests_attributes
7676
# If requested item(s) isn't visible to partners,
7777
# an error specifying which item is not available is raised
7878
def check_for_item_visibility
79-
invisible_items = item_requests_attributes.select { |attr| !included_items_by_id[attr[:item_id]].visible_to_partners }
79+
invisible_items = item_requests_attributes.select { |attr|
80+
!included_items_by_id[attr[:item_id]].nil? &&
81+
!included_items_by_id[attr[:item_id]].visible_to_partners
82+
}
8083

8184
unless invisible_items.empty?
8285

0 commit comments

Comments
 (0)