mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Fix filter failing on undefined endpoints
This commit is contained in:
parent
6b17690f21
commit
0cbe9b33d5
3 changed files with 9 additions and 0 deletions
|
|
@ -56,6 +56,9 @@ export class AppTemplate {
|
|||
|
||||
before: function( data ) {
|
||||
return data.filter( entry => {
|
||||
// Skip endpoints with no payload
|
||||
if ( entry === undefined || !entry.hasOwnProperty('payload') ) return false
|
||||
|
||||
const appType = getAppType( entry.payload.app )
|
||||
|
||||
return appType === 'app'
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ class FormulaTemplate extends AppTemplate {
|
|||
alias: 'app',
|
||||
before: function( data ) {
|
||||
return data.filter( entry => {
|
||||
// Skip endpoints with no payload
|
||||
if ( entry === undefined || !entry.hasOwnProperty('payload') ) return false
|
||||
|
||||
const appType = getAppType( entry.payload.app )
|
||||
|
||||
return appType === 'formula'
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ class TV {
|
|||
alias: 'payload',
|
||||
before: function( data ) {
|
||||
return data.filter( entry => {
|
||||
// Skip endpoints with no payload
|
||||
if ( entry === undefined || !entry.hasOwnProperty('payload') ) return false
|
||||
|
||||
return entry.payload.hasOwnProperty('video') && isVideo( entry.payload.video )
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue