KMimeType::findByUrl() returning null pointer

Hamish Rodda rodda at
Sat Sep 16 13:04:13 BST 2006


I'm encountering a crash in KFileInfo from a dereference of a null mimetype 
pointer in QString KFileItem::mimetype() const.  It turns out that the file 
(kdelibs/kate/tests/highlight.asm-avr) is detected as text/x-assembler, and 
there is no corresponding desktop file so findByUrl() returns null.

What is the correct fix here (other than creating the x-assembler desktop 
file, of course)... should KMimeType::findByUrl() check that the mimetype it 
has looked up is valid before returning it? (The docs say that a null pointer 
cannot be returned)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list