#fixed code
                                private void createComponents(){

        for (MapElement element : elements){

            IndoorObjectData data = new IndoorObjectData(buildingPart, element);

            switch (element.getTags().getValue("indoor")){

                case "wall":

                    walls.add(new IndoorWall(data));
                    break;

                case "room":

                    rooms.add(new IndoorRoom(data));
                    break;

                case "area":

                    areas.add(new IndoorArea(data));
                    break;

                case "corridor":

                    corridors.add(new Corridor(data));
                    break;

            }


        }

    }
#vulnerable code 
                                private void createComponents(){

        for (MapElement element : elements){

            switch (element.getTags().getValue("indoor")){

                case "wall":

                    walls.add(new IndoorWall(buildingPart, element));
                    break;

                case "room":

                    rooms.add(new IndoorRoom((MapArea) element, buildingPart));
                    break;

                case "area":

                    areas.add(new IndoorArea(buildingPart, (MapArea) element));
                    break;

                case "corridor":

                    corridors.add(new Corridor(buildingPart, (MapArea) element));
                    break;

            }


        }

    } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE