diff --git a/core2/Basetype2.cc b/core2/Basetype2.cc
index 3839dc55cf12d8c3724f01ed3c5408fac9dcbc60..bb0401b7775eee6a6a6c8568716bfd4e2ceb29e5 100644
--- a/core2/Basetype2.cc
+++ b/core2/Basetype2.cc
@@ -6301,6 +6301,9 @@ int Record_Type::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer&
       }
       if (field_count == field_idx) {
         // invalid field name
+        if (p_silent) {
+          return JSON_ERROR_INVALID_TOKEN;
+        }
         JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, is_metainfo ?
           JSON_DEC_METAINFO_NAME_ERROR : JSON_DEC_INVALID_NAME_ERROR, (int)name_len, name);
         // if this is set to a warning, skip the value of the field