Don't choke on missing API version

Closes #175.
This commit is contained in:
Tim Pope 2014-09-02 12:20:49 -04:00
parent b256399f3f
commit c1416c89ba

View File

@ -34,7 +34,7 @@ function! fireplace#nrepl#for(transport) abort
let client.transport = a:transport let client.transport = a:transport
let client.session = client.process({'op': 'clone', 'session': 0})['new-session'] let client.session = client.process({'op': 'clone', 'session': 0})['new-session']
let client.describe = client.process({'op': 'describe', 'verbose?': 1}) let client.describe = client.process({'op': 'describe', 'verbose?': 1})
if client.describe.versions.nrepl.major == 0 && if get(client.describe.versions.nrepl, 'major', -1) == 0 &&
\ client.describe.versions.nrepl.minor < 2 \ client.describe.versions.nrepl.minor < 2
throw 'nREPL: 0.2.0 or higher required' throw 'nREPL: 0.2.0 or higher required'
endif endif