openlvc / portico

Portico is an open source, cross-platform, fully supported HLA RTI implementation. Designed with modularity and flexibility in mind, Portico is a production-grade RTI for the Simulation and Training Community, so come say hi!
http://www.porticoproject.org
151 stars 81 forks source link

Creating a Federation Execution with a `null` or empty FOM array throws NullPointerException/IndexOutOfBoundsException #286

Open adlaws opened 5 years ago

adlaws commented 5 years ago

Attempts to create a federation execution with a null for the FOM modules parameter fail with a NullPointerException.

There are a few places in the code which cause this, depending on which version/method signature of the createFederationExecution method is invoked, but they all basically come down to an assumption that the fomModules parameter is non-null. These are...

org.portico.lrc.services.federation.msg.CreateFederation:

org.portico.impl.hla1516e.Rti1516eAmbassador#createFederationExecution( String federationName, URL[] fomModules, URL mimModule ):

org.portico.lrc.model.ModelMerger#mergeModels( List<ObjectModel> models ):

adlaws commented 5 years ago

See pull request https://github.com/openlvc/portico/pull/287 for proposed fix.