From 58b0fe2f2870471a9b0c4e04c4fde3595a9fcbdb Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 15 Jan 2017 14:41:49 +0100 Subject: [PATCH] Fix #449 - don't do relationships fetch for empty array of IDs --- app/assets/javascripts/components/actions/accounts.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/components/actions/accounts.jsx b/app/assets/javascripts/components/actions/accounts.jsx index 7ae87f30ed..e1519d7b56 100644 --- a/app/assets/javascripts/components/actions/accounts.jsx +++ b/app/assets/javascripts/components/actions/accounts.jsx @@ -486,6 +486,10 @@ export function expandFollowingFail(id, error) { export function fetchRelationships(account_ids) { return (dispatch, getState) => { + if (account_ids.length === 0) { + return; + } + dispatch(fetchRelationshipsRequest(account_ids)); api(getState).get(`/api/v1/accounts/relationships?${account_ids.map(id => `id[]=${id}`).join('&')}`).then(response => {