RomainVialard / FirebaseApp

Google Apps Script binding for Firebase Realtime Database
Apache License 2.0
117 stars 30 forks source link

GAS V8 runtime bug #25

Open Rohed opened 4 years ago

Rohed commented 4 years ago

Switched to V8 Runtime and getting a bug where when, requesting to an endpoint which would normally return 'null' the whole script crashes with the 'Error connecting to Google Server'.

Well I loaded the library locally and this fix seems to do the job baseClass.getData = function (path, optQueryParameters) { // Send request // noinspection JSAnnotator var [res] = FirebaseApp._buildAllRequests([ { method: 'get', path: path, optQueryParameters: optQueryParameters, }, ], this);

// Throw error if (res instanceof Error) { throw res; }

if(res){ return res; } };

TLDR: dont return anything if the value to be returned is null.