aboutsummaryrefslogtreecommitdiffstats
path: root/src/plainTextPart.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-23 08:25:38 +0000
committerVincent Richard <[email protected]>2013-11-23 08:25:38 +0000
commit7aebeeb2e2ad13c89c202d0bfa8c634ab27b91b4 (patch)
tree591c6558daf2773bb0ce913e39189b295d9406c9 /src/plainTextPart.cpp
parentDo not throw exception for normal code flow (exceptions::no_such_field). (diff)
downloadvmime-7aebeeb2e2ad13c89c202d0bfa8c634ab27b91b4.tar.gz
vmime-7aebeeb2e2ad13c89c202d0bfa8c634ab27b91b4.zip
Do not throw exception for normal code flow (exceptions::no_such_parameter).
Diffstat (limited to 'src/plainTextPart.cpp')
-rw-r--r--src/plainTextPart.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp
index bdb76c4d..7a1542d7 100644
--- a/src/plainTextPart.cpp
+++ b/src/plainTextPart.cpp
@@ -78,21 +78,10 @@ void plainTextPart::parse(shared_ptr <const bodyPart> /* message */,
shared_ptr <const contentTypeField> ctf =
textPart->getHeader()->findField <contentTypeField>(fields::CONTENT_TYPE);
- if (ctf)
- {
- try
- {
- m_charset = ctf->getCharset();
- }
- catch (exceptions::no_such_parameter&)
- {
- // No "charset" parameter.
- }
- }
+ if (ctf && ctf->hasCharset())
+ m_charset = ctf->getCharset();
else
- {
- // No "Content-type" field.
- }
+ m_charset = charset();
}