diff options
| author | Jonathan Thomas <echidnaman@kubuntu.org> | 2012-04-01 22:21:04 (GMT) |
|---|---|---|
| committer | Jonathan Thomas <echidnaman@kubuntu.org> | 2012-04-01 22:22:53 (GMT) |
| commit | 61e27b31f8f4b10e1378ba700345acecc3b6c9c5 (patch) | |
| tree | f08635dcb5d96df8b1a0e99c8363539c4b5b0f99 | |
| parent | 73aef5d52784028a9856348dfae7fa2b4596c749 (diff) | |
KMimeType::mimeType() can return null if the mimetype is not found, so check the pointer before we use it to avoid crashing.
CCMAIL:948973@bugs.launchpad.net
| -rw-r--r-- | nepomuk/utils/utils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nepomuk/utils/utils.cpp b/nepomuk/utils/utils.cpp index 5dab792..d4c1f28 100644 --- a/nepomuk/utils/utils.cpp +++ b/nepomuk/utils/utils.cpp @@ -138,7 +138,8 @@ QString Nepomuk::Utils::formatPropertyValue( const Nepomuk::Types::Property& pro } else if(property == Vocabulary::NIE::mimeType()) { - valueString = KMimeType::mimeType(value.toString())->comment(); + KMimeType::Ptr mimeType = KMimeType::mimeType(value.toString()); + valueString = (mimeType ? mimeType->comment() : value.toString()); } else { |
