fix(Search): check if WatchCardHeroVideo is null before casting

Related #243
This commit is contained in:
LuanRT
2022-11-25 01:25:02 -03:00
parent f7c1e0f249
commit 2a87f42b32

View File

@@ -40,8 +40,8 @@ class Search extends Feed {
this.watch_card = {
header: universal_watch_card?.header.item() || null,
call_to_action: universal_watch_card?.call_to_action.item().as(WatchCardHeroVideo) || null,
sections: universal_watch_card?.sections.array().filterType(WatchCardSectionSequence) || []
call_to_action: universal_watch_card?.call_to_action?.item()?.as(WatchCardHeroVideo) || null,
sections: universal_watch_card?.sections?.array()?.filterType(WatchCardSectionSequence) || []
};
this.refinement_cards = {