diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -55,7 +55,7 @@ function getTarget (abi, runtime) {
     .map(function (t) {
       return t.target
     })
-  if (match) return match[0]
+  if (match.length) return match[0]
 
   throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime)
 }
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -15,6 +15,7 @@ test('getTarget calculates correct Node target', function (t) {
 })
 
 test('getTarget calculates correct Electron target', function (t) {
+  t.throws(getTarget.bind(null, '14', 'electron'))
   t.equal(getTarget('47', 'electron'), '1.0.2')
   t.equal(getTarget('48', 'electron'), '1.2.8')
   t.equal(getTarget('49', 'electron'), '1.3.13')
fix case where there is no electron match