diff --git a/libdokan/folderlist.go b/libdokan/folderlist.go
index <HASH>..<HASH> 100644
--- a/libdokan/folderlist.go
+++ b/libdokan/folderlist.go
@@ -56,15 +56,15 @@ func (fl *FolderList) reportErr(ctx context.Context,
 // Dir.open as necessary.
 func (fl *FolderList) open(ctx context.Context, oc *openContext, path []string) (f dokan.File, isDir bool, err error) {
 	fl.fs.log.CDebugf(ctx, "FL Lookup %#v", path)
+	if len(path) == 0 {
+		return oc.returnDirNoCleanup(fl)
+	}
+
 	defer func() {
 		fl.reportErr(ctx, libkbfs.ReadMode,
 			libkbfs.CanonicalTlfName(path[0]), err)
 	}()
 
-	if len(path) == 0 {
-		return oc.returnDirNoCleanup(fl)
-	}
-
 	for oc.reduceRedirectionsLeft() {
 		name := path[0]
libdokan: Fix crash in github issue <I>