Skip to content
TORNLIFE More

API returns Array instead of Object when empty

Started by Pi77Bull [2082618] on in Bugs & Issues.

2 replies · 604 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
3
Discussion span
→
People posting
3
Likes on archived posts
3
Posts by staff, officers and moderators
1
Authority score
60 / 100
Historical score
34 / 100
Story score
41 / 100
Engagement score
55 / 100

Most-liked replies

Pi77Bull [2082618]
Usually a request to user>attacks returns { "attacks": { ... } } where the value of "attacks" is an Object, but when "attacks" should be empty (e.g. /user/?selections=attacks&from=[some timestamp from the future] ) it returns { "attacks": [] } where "attacks" is an empty Array.

I have only tested this with user>attacks so it could be happening in other places too.
Chedburn [1] Admin Developer
Sure I've changed empty attack logs to be in object format when empty, for users and faction selections.

Will be live on Tuesday.