Ugh, these things happen, after writing for help you’ll find the solution by yourself.
Definately not the most elegant solution, but it did the trick for me. I modified the the_meta() to be like this:
function the_meta() {
if ( $keys = get_post_custom_keys() ) {
$smgv = 0;
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
if ( '_' == $keyt{0} )
continue;
if ( $smgv == 0 ) {
echo "<ul class='post-meta'>\n";
$smgv = 1;
}
$values = array_map('trim', get_post_custom_values($key));
$value = implode($values,', ');
echo apply_filters('the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value);
}
if ( $smgv == 1 ) {
echo "</ul>\n";
}
}
}
My conclusion: despite the comments in post.php get_post_custom_keys() does NOT return NULL when there is no custom data.
I won’t delete this thread, maybe it will help someone in the future.