diff --git a/plugins/tab/tab.fish b/plugins/tab/tab.fish
index b01c5b900bb744c9546f81b42ce94ad8f7fd2d2d..fa6248a4978b76931de29c106ca50aa6d5015309 100644
--- a/plugins/tab/tab.fish
+++ b/plugins/tab/tab.fish
@@ -12,12 +12,14 @@ function tab -d 'Open the current directory (or any other directory) in a new ta
   set -l cmd ''
   set -l cdto $PWD
 
-  if test (count $argv) -gt 0 -a -d $argv[1]
-    pushd . >/dev/null
-    cd $argv[1]
-    set cdto $PWD
-    set -e argv[1]
-    popd >/dev/null
+  if test (count $argv) -gt 0
+    if test -d $argv[1]
+      pushd . >/dev/null
+      cd $argv[1]
+      set cdto $PWD
+      set -e argv[1]
+      popd >/dev/null
+    end
   end
 
   if test (count $argv) -gt 0