Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

rl.history is undefined #6

Open
benthepoet opened this issue Jun 1, 2016 · 4 comments
Open

rl.history is undefined #6

benthepoet opened this issue Jun 1, 2016 · 4 comments

Comments

@benthepoet
Copy link
Contributor

I'm using Node 4.4.5. When trying to encrypt or decrypt Node crashes because it's trying to call slice on rl.history which hasn't been defined yet.

C:\Users\benhanna\Git\project\node_modules\config-leaf\index.js:34
        rl.history = rl.history.slice(1);
                               ^

TypeError: Cannot read property 'slice' of undefined
    at C:\Users\benhanna\Git\project\node_modules\config-leaf\index.js:34:32
    at Interface._onLine (readline.js:209:5)
    at Interface.<anonymous> (readline.js:341:12)
    at Array.forEach (native)
    at Interface._normalWrite (readline.js:340:11)
    at Socket.ondata (readline.js:87:10)
    at emitOne (events.js:82:20)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
@jed
Copy link
Owner

jed commented Jun 1, 2016

hey @benthepoet, can you update the test to cover your issue? tests run fine for me on v4.4.5,

@benthepoet
Copy link
Contributor Author

Well it's the same commands in the test file that are failing for me. I'm using Windows 10 with Git Bash as my terminal. When you use Git Bash it blows up with the error above. However, using decrypt or encrypt in Command Prompt works successfully. Should probably just put in a safety to initialize rl.history to an empty string if it's undefined.

@jed
Copy link
Owner

jed commented Jun 1, 2016

cool. can you tee up a PR with the change you need?

@benthepoet
Copy link
Contributor Author

benthepoet commented Jun 1, 2016

Yeah, I'll send one up when I get a chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants