File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -3237,15 +3237,14 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo<Value>& args) {
3237
3237
ASSIGN_OR_RETURN_UNWRAP (&hmac, args.Holder ());
3238
3238
3239
3239
// Only copy the data if we have to, because it's a string
3240
- bool r = true ;
3240
+ bool r = false ;
3241
3241
if (args[0 ]->IsString ()) {
3242
3242
StringBytes::InlineDecoder decoder;
3243
- if (!decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8)) {
3244
- args.GetReturnValue ().Set (false );
3245
- return ;
3243
+ if (decoder.Decode (env, args[0 ].As <String>(), args[1 ], UTF8)) {
3244
+ r = hmac->HmacUpdate (decoder.out (), decoder.size ());
3246
3245
}
3247
- r = hmac-> HmacUpdate (decoder. out (), decoder. size ());
3248
- } else if (args[0 ]->IsArrayBufferView ()) {
3246
+ } else {
3247
+ CHECK (args[0 ]->IsArrayBufferView ());
3249
3248
char * buf = Buffer::Data (args[0 ]);
3250
3249
size_t buflen = Buffer::Length (args[0 ]);
3251
3250
r = hmac->HmacUpdate (buf, buflen);
You can’t perform that action at this time.
0 commit comments