🐛 Do not error if there is no data on Google Analytics + Sort

This commit is contained in:
Jan Oberhauser
2021-06-25 15:38:32 +02:00
parent fe71c665fe
commit 6c7e1ec3c9
2 changed files with 13 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOp
export function simplify(responseData: any | [any]) { // tslint:disable-line:no-any
const response = [];
for (const { columnHeader: { dimensions }, data: { rows } } of responseData) {
if (rows === undefined) {
// Do not error if there is no data
continue;
}
for (const row of rows) {
const data: IDataObject = {};
if (dimensions) {