Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

more compact wp guard

as-opc155ad632ffc
diff --git a/app/models/work_package/pdf_export/export/markdown.rb b/app/models/work_package/pdf_export/export/markdown.rb
index 43a69166281..9ffb68475b1 100644
--- a/app/models/work_package/pdf_export/export/markdown.rb
+++ b/app/models/work_package/pdf_export/export/markdown.rb
@@ -112,7 +112,7 @@ module WorkPackage::PDFExport::Export::Markdown
return [text_hash(content, opts)] if id.blank?
work_package = WorkPackage.find_by(id: id)
- return [text_hash(content, opts)] if work_package.nil? || !work_package.visible?
+ return [text_hash(content, opts)] unless work_package&.visible?
content = expand_wp_mention(work_package, content)
[text_hash(content, opts.merge({ link: url_helpers.work_package_url(id) }))]