diff --git a/inc/documents.php b/inc/documents.php
index 4d7e5d60b5b540094185958c5cdda1117eaafb10..dba833f8c99f826acdc194754714027bedffbf01 100644
--- a/inc/documents.php
+++ b/inc/documents.php
@@ -150,6 +150,7 @@ function vignette_automatique($img, $doc, $lien, $x=0, $y=0, $align='', $class='
 function image_du_document($document)
 {
 	if ($e = $document['extension']
+	  AND isset($GLOBALS['meta']['formats_graphiques'])
 	  AND (strpos($GLOBALS['meta']['formats_graphiques'], $e) !== false)
 	  AND (!test_espace_prive() OR $GLOBALS['meta']['creer_preview']=='oui')
 	  AND $document['fichier']) {