summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diffcore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h
index f1b5ca748c..ac159d7154 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -33,7 +33,7 @@ struct diff_filespec {
* if false, use the name and read from
* the filesystem.
*/
-#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
+#define DIFF_FILE_VALID(spec) ((spec) && ((spec)->mode) != 0)
unsigned should_free : 1; /* data should be free()'ed */
unsigned should_munmap : 1; /* data should be munmap()'ed */
};