mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-04 09:26:15 +01:00 
			
		
		
		
	fixed nullPointer
This commit is contained in:
		@@ -95,8 +95,14 @@ public class PropertyOverviewMenu extends Dialog {
 | 
				
			|||||||
        // Fetch the current player
 | 
					        // Fetch the current player
 | 
				
			||||||
        Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId());
 | 
					        Player currentPlayer = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Iterate through the player's properties
 | 
					        // Fetch the player's properties using their indices
 | 
				
			||||||
        for (PropertyField property : currentPlayer.getPropertyFields()) {
 | 
					        List<PropertyField> fields = new ArrayList<>();
 | 
				
			||||||
 | 
					        for (Integer i : currentPlayer.getProperties()) {
 | 
				
			||||||
 | 
					            fields.add((PropertyField) app.getGameLogic().getBoardManager().getFieldAtIndex(i));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Iterate through the fetched properties
 | 
				
			||||||
 | 
					        for (PropertyField property : fields) {
 | 
				
			||||||
            if (property instanceof BuildingProperty) {
 | 
					            if (property instanceof BuildingProperty) {
 | 
				
			||||||
                BuildingProperty building = (BuildingProperty) property;
 | 
					                BuildingProperty building = (BuildingProperty) property;
 | 
				
			||||||
                cards.add(createBuildingCard(building));
 | 
					                cards.add(createBuildingCard(building));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user