msmobility / silo

SILO Model Java Code
GNU General Public License v2.0
18 stars 26 forks source link

Null pointers when accessing non-existent attributes #283

Closed nkuehnel closed 4 years ago

nkuehnel commented 4 years ago

Silo currently crashes in ModeChoiceResultsMonitor (muc).

                    int parkingAtHome = (int) dd.getAttributes().get("PARKING_SPACES");

We should be more careful when using those attributes. An idea qould be to offer a method that returns an Optional, such that clients have to take care of possible nulls