diff --git a/include/MacStd/Security.hpp b/include/MacStd/Security.hpp index b8af425..1ea3d80 100644 --- a/include/MacStd/Security.hpp +++ b/include/MacStd/Security.hpp @@ -61,7 +61,7 @@ namespace macstd case errAuthorizationInteractionNotAllowed: return "User interaction not allowed for authorization"; } cfstring cfstr(SecCopyErrorMessageString(num, NULL)); - if (!cfstr) + if (!cfstr.valid()) return "Security Framework error " + std::to_string(num); auto ptr = CFStringGetCStringPtr(cfstr, kCFStringEncodingUTF8); if (!ptr)