urbanriskmap / cognicity-grasp

Geosocial Rapid Assessment Platform for CogniCity
GNU General Public License v3.0
1 stars 1 forks source link

ReportCard.js causes a crash if result object is undefined #10

Closed abrahamq closed 8 years ago

abrahamq commented 8 years ago

Putting this here so I remember to fix it later.

I think we're not doing error checking correctly in ReportCard.js.

/Users/abrahamq/Documents/urop/cognicity-grasp/ReportCard.js:157 else if (result[0].received === false){ ^

TypeError: Cannot read property 'received' of undefined at /Users/abrahamq/Documents/urop/cognicity-grasp/ReportCard.js:157:29 at null. (/Users/abrahamq/Documents/urop/cognicity-grasp/ReportCard.js:85:6) at Query.handleReadyForQuery (/Users/abrahamq/Documents/urop/cognicity-grasp/node_modules/pg/lib/query.js:114:10) at null. (/Users/abrahamq/Documents/urop/cognicity-grasp/node_modules/pg/lib/client.js:172:19) at emitOne (events.js:82:20) at emit (events.js:169:7) at Socket. (/Users/abrahamq/Documents/urop/cognicity-grasp/node_modules/pg/lib/connection.js:121:12) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:146:16)

MaanasaPriyaa commented 8 years ago

There is an issue assigned to me that discusses about error handling. I guess this will come under that issue. Can you check? I'm planning to work on this today.

tomasholderness commented 8 years ago

I refactored a lot of the ReportCard.js code yesterday to help make it more testable.

The above error should have been fixed in: https://github.com/urbanriskmap/cognicity-grasp/commit/691a2031452f009466c1d86cb80a373220997cf7

abrahamq commented 8 years ago

Hey, sorry didn't see that, maybe we should merge master into mvp-cards?

On Oct 18, 2016 11:28 AM, "Tomas Holderness" notifications@github.com wrote:

I refactored a lot of the ReportCard.js code yesterday to help make it more testable.

The above error should have been fixed in: 691a203 https://github.com/urbanriskmap/cognicity-grasp/commit/691a2031452f009466c1d86cb80a373220997cf7

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/urbanriskmap/cognicity-grasp/issues/10#issuecomment-254544457, or mute the thread https://github.com/notifications/unsubscribe-auth/AIT_WwiHA_zTAJQXtC0OoEK2MJCwyFQBks5q1OW7gaJpZM4KZnHB .

tomasholderness commented 8 years ago

Yes - probably good to do this incrementally. I've finished updating with the ReportCard.js logic for the time being, but now working on Bot.js.

tomasholderness commented 8 years ago

Hi @abrahamq - now you've pulled latest master to MVP can we close this?

abrahamq commented 8 years ago

I think so, let me make sure tonight and I'll close it.

On Oct 26, 2016 3:54 PM, "Tomas Holderness" notifications@github.com wrote:

Hi @abrahamq https://github.com/abrahamq - now you've pulled latest master to MVP can we close this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/urbanriskmap/cognicity-grasp/issues/10#issuecomment-256458724, or mute the thread https://github.com/notifications/unsubscribe-auth/AIT_W24sxUuRFme2NMvj4zOBKUQGjuV8ks5q37APgaJpZM4KZnHB .