diff --git a/tsk/fs/ext2fs.c b/tsk/fs/ext2fs.c
index f804078d106720b38c50036e1fa5a626ef550397..56e9b1c6696a54255e8cc4a20e2964d25b2b76e0 100755
--- a/tsk/fs/ext2fs.c
+++ b/tsk/fs/ext2fs.c
@@ -1595,7 +1595,7 @@ static uint8_t
 ext2fs_handle_implicit_sparse_data_run(TSK_FS_INFO * fs_info, TSK_FS_ATTR * fs_attr) {
     TSK_FS_FILE *fs_file = fs_attr->fs_file;
 
-    if (fs_attr == NULL) {
+    if (fs_file == NULL) {
         return 1;
     }