Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Error: NoMethodError (undefined method `match' for nil:NilClass) #15

Open
rg-ac opened this issue Jan 15, 2018 · 1 comment
Open

Comments

@rg-ac
Copy link

rg-ac commented Jan 15, 2018

On some pages I have an 'Internal Error' and in the logfile I see:

NoMethodError (undefined method match' for nil:NilClass): plugins/redmine_doc_pu/lib/latex_wiki_page.rb:10:in block in to_latex'
plugins/redmine_doc_pu/lib/latex_wiki_page.rb:9:in to_latex' plugins/redmine_doc_pu/app/models/doc_pu_wiki_page.rb:24:in to_latex'
plugins/redmine_doc_pu/lib/latex_doc.rb:67:in block in to_latex' plugins/redmine_doc_pu/lib/latex_doc.rb:66:in to_latex'
plugins/redmine_doc_pu/lib/latex_doc.rb:120:in build' plugins/redmine_doc_pu/app/models/doc_pu_document.rb:27:in build'
plugins/redmine_doc_pu/app/controllers/doc_pu_controller.rb:101:in build_remote' lib/redmine/sudo_mode.rb:63:in sudo_mode'

Environment:
Redmine version 3.2.8.stable
Ruby version 2.2.9-p480 (2017-12-15) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.8
Git 1.9.1
Filesystem
Redmine plugins:
redmine_backlogs v1.0.6
redmine_base_deface 0.0.1
redmine_doc_pu 2.1.0
redmine_maintenance_mode 2.1.0

Any Ideas?

@rg-ac
Copy link
Author

rg-ac commented Jan 25, 2018

Here is a diff which fixed it for me

--- a/lib/latex_wiki_page.rb
+++ b/lib/latex_wiki_page.rb
@@ -7,8 +7,10 @@ module ModuleLatexWikiPage
# Collect all attached images and get disk filename
file_sub = {}
self.wiki_page.attachments.each do |att|
- unless att.content_type.match(/^image/i).nil?
- file_sub[att.filename] = att.diskfile
+ if att.content_type
+ unless att.content_type.match(/^image/i).nil?
+ file_sub[att.filename] = att.diskfile
+ end
end
end

btw. how to paste Diff in markdown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant