santinic / how2

AI for the Command Line
https://how2terminal.com
MIT License
5.72k stars 156 forks source link

How2 crashes when pressing space while viewing a question with no answers #63

Closed luigimannoni closed 8 years ago

luigimannoni commented 8 years ago

Steps to reproduce:

screen shot 2016-03-15 at 10 24 29
TypeError: Cannot read property 'body_markdown' of undefined
    at Object.showAnswer (/usr/local/lib/node_modules/how2/lib/ui.js:177:46)
    at /usr/local/lib/node_modules/how2/lib/how2.js:120:20
    at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/lib/ui.js:151:9)
    at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
    at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
    at ScrollableBox.List.enterSelected (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/list.js:586:8)
    at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/lib/ui.js:155:21)
    at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
    at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
    at Program.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/screen.js:603:15)
danyshaanan commented 8 years ago

Fix: https://github.com/santinic/how2/pull/64

To reproduce the problem I used this question:

./bin/how2 docker compose create containers

(second question has no answers)