summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filefield.module3
1 files changed, 1 insertions, 2 deletions
diff --git a/filefield.module b/filefield.module
index 2caafb5..15f7b6a 100644
--- a/filefield.module
+++ b/filefield.module
@@ -180,8 +180,7 @@ function filefield_file_download($file) {
if (isset($nodes[$content['nid']])) {
continue; // Don't check the same node twice.
}
- $node = node_load($content['nid']);
- if ($denied == FALSE && node_access('view', $node) == FALSE) {
+ if ($denied == FALSE && ($node = node_load($content['nid'])) && node_access('view', $node) == FALSE) {
// You don't have permission to view the node this file is attached to.
$denied = TRUE;
}