do not allow access to rigid body properties before they are fully set up

This commit is contained in:
Axel Kohlmeyer
2020-10-31 11:48:29 -04:00
parent 980fce06de
commit 66ed16760f
2 changed files with 8 additions and 0 deletions

View File

@ -2710,11 +2710,15 @@ double FixRigid::compute_scalar()
void *FixRigid::extract(const char *str, int &dim)
{
dim = 0;
if (strcmp(str,"body") == 0) {
if (!setupflag) return nullptr;
dim = 1;
return body;
}
if (strcmp(str,"masstotal") == 0) {
if (!setupflag) return nullptr;
dim = 1;
return masstotal;
}