mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -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 ) {
|
before: function( data ) {
|
||||||
return data.filter( entry => {
|
return data.filter( entry => {
|
||||||
|
// Skip endpoints with no payload
|
||||||
|
if ( entry === undefined || !entry.hasOwnProperty('payload') ) return false
|
||||||
|
|
||||||
const appType = getAppType( entry.payload.app )
|
const appType = getAppType( entry.payload.app )
|
||||||
|
|
||||||
return appType === 'app'
|
return appType === 'app'
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ class FormulaTemplate extends AppTemplate {
|
||||||
alias: 'app',
|
alias: 'app',
|
||||||
before: function( data ) {
|
before: function( data ) {
|
||||||
return data.filter( entry => {
|
return data.filter( entry => {
|
||||||
|
// Skip endpoints with no payload
|
||||||
|
if ( entry === undefined || !entry.hasOwnProperty('payload') ) return false
|
||||||
|
|
||||||
const appType = getAppType( entry.payload.app )
|
const appType = getAppType( entry.payload.app )
|
||||||
|
|
||||||
return appType === 'formula'
|
return appType === 'formula'
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ class TV {
|
||||||
alias: 'payload',
|
alias: 'payload',
|
||||||
before: function( data ) {
|
before: function( data ) {
|
||||||
return data.filter( entry => {
|
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 )
|
return entry.payload.hasOwnProperty('video') && isVideo( entry.payload.video )
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue