DIRECTIR: LINGO: Do not crash on 'the number of castmembers' when Shared Cast is not present

This commit is contained in:
Eugene Sandulenko 2022-06-23 01:23:58 +02:00
parent 89c4a1c7e1
commit 1e1703bf37
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -390,7 +390,7 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
break;
case kTheCastMembers:
d.type = INT;
d.u.i = movie->getCast()->_loadedCast->size() + movie->_sharedCast->_loadedCast->size();
d.u.i = movie->getCast()->_loadedCast->size() + (movie->_sharedCast ? movie->_sharedCast->_loadedCast->size() : 0);
break;
case kTheCenterStage:
d.type = INT;