Check for null return from which().
diff --git a/lib/cli_util.dart b/lib/cli_util.dart
index a997c43..ac767b2 100644
--- a/lib/cli_util.dart
+++ b/lib/cli_util.dart
@@ -37,6 +37,7 @@
 
   // Try and locate the VM using 'which'.
   String executable = whichSync('dart', orElse: () => null);
+  if (executable == null) return null;
 
   // In case Dart is symlinked (e.g. homebrew on Mac) follow symbolic links.
   Link link = new Link(executable);