summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index cc4e7a38165..2310e67cb2e 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -110,14 +110,16 @@ class FileUploader < GitlabUploader
end
def upload=(value)
- unless apply_context!(value.uploader_context)
- if matches = DYNAMIC_PATH_PATTERN.match(value.path)
- @secret = matches[:secret]
- @identifier = matches[:identifier]
- end
- end
-
super
+
+ return unless value
+ return if apply_context!(value.uploader_context)
+
+ # fallback to the regex based extraction
+ if matches = DYNAMIC_PATH_PATTERN.match(value.path)
+ @secret = matches[:secret]
+ @identifier = matches[:identifier]
+ end
end
def secret