aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-03-20 22:13:33 +0000
committerFrancis Irving <francis@mysociety.org>2010-03-20 22:13:33 +0000
commit0e8f9db5038c5dc7e41d9f5dbca531978456c4e9 (patch)
tree38615430d685a7072f7f254dfc73dbe5483ebeb5 /app/models
parent09449e0cb034134290a90c80498d591a831c2d02 (diff)
parentd29fd88e3c54a5a5a94b29d16cb46dd859b59e05 (diff)
Merge commit 'peter/pdftk-silent-failure'
Diffstat (limited to 'app/models')
-rw-r--r--app/models/incoming_message.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 8ea4f0fb7..29dfb4089 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -543,7 +543,7 @@ class IncomingMessage < ActiveRecord::Base
uncompressed_text = child.read()
end
# if we managed to uncompress the PDF...
- if !uncompressed_text.nil?
+ if !uncompressed_text.nil? && !uncompressed_text.empty?
# then censor stuff (making a copy so can compare again in a bit)
censored_uncompressed_text = uncompressed_text.dup
self._binary_mask_stuff_internal!(censored_uncompressed_text)
@@ -556,7 +556,7 @@ class IncomingMessage < ActiveRecord::Base
child.close_write()
recompressed_text = child.read()
end
- if !recompressed_text.nil?
+ if !recompressed_text.nil? && !recompressed_text.empty?
text[0..-1] = recompressed_text # [0..-1] makes it change the 'text' string in place
end
end