--- a/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2024-01-15 20:17:22.044947545 +0300 +++ b/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2024-01-15 20:24:39.422251196 +0300 @@ -458,7 +458,7 @@ // } void JvmtiClassFileReconstituter::write_record_attribute() { Array* components = ik()->record_components(); - int number_of_components = components->length(); + int number_of_components = components ? components->length() : 0; // Each component has a u2 for name, descr, attribute count int length = sizeof(u2) + (sizeof(u2) * 3 * number_of_components);