diff --git a/src/Common/Token.cpp b/src/Common/Token.cpp index 17fce78b..29022d27 100644 --- a/src/Common/Token.cpp +++ b/src/Common/Token.cpp @@ -109,6 +109,10 @@ namespace VeraCrypt } } + // Callers use the keyfile directly, so any other path is an error. + if (!tokenKeyfile) + throw InvalidSecurityTokenKeyfilePath(); + return tokenKeyfile; } } \ No newline at end of file