Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 2afa3f0

Browse files
committed
Fixed bug reported in #85
1 parent 0879b0e commit 2afa3f0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/simulation/propagation_setup/setNumericallyIntegratedStates.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,18 @@ void checkTranslationalStatesFeasibility(
3333
if( std::find( bodiesToIntegrate.begin( ), bodiesToIntegrate.end( ), bodyIterator.first ) ==
3434
bodiesToIntegrate.end( ) )
3535
{
36-
std::string ephemerisOrigin
37-
= bodyIterator.second->getEphemeris( )->getReferenceFrameOrigin( );
38-
39-
if( std::find( bodiesToIntegrate.begin( ), bodiesToIntegrate.end( ), ephemerisOrigin )
40-
!= bodiesToIntegrate.end( ) )
36+
if( bodyIterator.second->getEphemeris( ) != nullptr )
4137
{
42-
std::cerr << "Warning, found non-integrated body with an integrated body as ephemeris origin" +
43-
bodyIterator.second->getEphemeris( )->getReferenceFrameOrigin( ) + " " +
44-
bodyIterator.first << std::endl;
38+
std::string ephemerisOrigin
39+
= bodyIterator.second->getEphemeris( )->getReferenceFrameOrigin( );
40+
41+
if( std::find( bodiesToIntegrate.begin( ), bodiesToIntegrate.end( ), ephemerisOrigin )
42+
!= bodiesToIntegrate.end( ) )
43+
{
44+
std::cerr << "Warning, found non-integrated body with an integrated body as ephemeris origin" +
45+
bodyIterator.second->getEphemeris( )->getReferenceFrameOrigin( ) + " " +
46+
bodyIterator.first << std::endl;
47+
}
4548
}
4649
}
4750

0 commit comments

Comments
 (0)