@@ -1377,7 +1377,7 @@ static void doFindMostReadyWeaponForThing( Object *obj, void *userData )
1377
1377
return ;
1378
1378
}
1379
1379
1380
- if ( info->thing ->isEquivalentTo ( obj->getTemplate () ) )
1380
+ if ( info->thing && info-> thing ->isEquivalentTo ( obj->getTemplate () ) )
1381
1381
{
1382
1382
if ( !obj->testStatus ( OBJECT_STATUS_UNDER_CONSTRUCTION )
1383
1383
&& !obj->testStatus ( OBJECT_STATUS_SOLD )
@@ -1409,7 +1409,7 @@ static void doFindMostReadySpecialPowerForThing( Object *obj, void *userData )
1409
1409
return ;
1410
1410
}
1411
1411
1412
- if ( info->thing ->isEquivalentTo ( obj->getTemplate () ) )
1412
+ if ( info->thing && info-> thing ->isEquivalentTo ( obj->getTemplate () ) )
1413
1413
{
1414
1414
if ( !obj->testStatus ( OBJECT_STATUS_UNDER_CONSTRUCTION )
1415
1415
&& !obj->testStatus ( OBJECT_STATUS_SOLD )
@@ -1445,7 +1445,7 @@ static void doFindExistingObjectWithThingTemplate( Object *obj, void *userData )
1445
1445
return ;
1446
1446
}
1447
1447
1448
- if ( info->thing ->isEquivalentTo ( obj->getTemplate () ) )
1448
+ if ( info->thing && info-> thing ->isEquivalentTo ( obj->getTemplate () ) )
1449
1449
{
1450
1450
if ( !obj->testStatus ( OBJECT_STATUS_UNDER_CONSTRUCTION )
1451
1451
&& !obj->testStatus ( OBJECT_STATUS_SOLD )
@@ -2863,7 +2863,7 @@ static void countExisting( Object *obj, void *userData )
2863
2863
TypeCountData *typeCountData = (TypeCountData *)userData;
2864
2864
2865
2865
// Compare templates
2866
- if ( typeCountData->type -> isEquivalentTo ( obj->getTemplate () ) ||
2866
+ if ( ( typeCountData->type && typeCountData-> type -> isEquivalentTo ( obj->getTemplate () ) ) ||
2867
2867
( typeCountData->linkKey != NAMEKEY_INVALID && obj->getTemplate () != NULL && typeCountData->linkKey == obj->getTemplate ()->getMaxSimultaneousLinkKey () ) )
2868
2868
{
2869
2869
typeCountData->count ++;
0 commit comments