Template function specialization with code duplication
The check is better factored into a specialization on a traits class. This allows you to have one implementation of the overall logic flow, and just specialize the part that changes. I haven't fully researched the implications of this approach, but I expect that due to the always true/false nature of the check (for most given types), that it will be easily optimized away.

It would look something like this:

// traits class to determine whether to do the check
template &lt;typename&gt; struct ResultCanBeNull : std::false_type {};
template &lt;&gt; struct ResultCanBeNull&lt;char*&gt; : std::true_type {};

template&lt;typename ResultType, typename v8MappingType&gt;
v8::Handle&lt;v8::Value&gt; Curl::GetInfoTmpl( const Curl &amp;obj, int infoId )
{
    v8::HandleScope scope;

    ResultType result;

    CURLINFO info = (CURLINFO) infoId;
    CURLcode code = curl_easy_getinfo( obj.curl, info, &amp;result );

    // use the traits class to filter in or out the null pointer check
    if ( ResultCanBeNull&lt;ResultType&gt;::value &amp;&amp; !result ) { //null pointer
        return v8::String::New( "" );
    }

    if ( code != CURLE_OK )
        return Curl::Raise( "curl_easy_getinfo failed!", curl_easy_strerror( code ) );

    return scope.Close( v8MappingType::New( result ) );
}


You could also implement the traits support as a method instead, in case it's not valid to call !result on instances of other types that are reasonable for ResultType.

template &lt;typename ResultType&gt;
struct ResultTraits {
    bool IsNull(const ResultType&amp;) { return false; }
};
template&lt;&gt; bool ResultTraits&lt;char const*&amp;&gt;::IsNull(char const*&amp; pchar) {
    return !pchar;
};

: : :

    if (ResultTraits&lt;ResultType&gt;::IsNull(result)) {
        return v8::String::New( "" );
    }