You should probably check here whether the `MCValueRef` is actually an `MCStringRef` by calling `MCValueGetTypeCode()`, and return `false` in case it's not.