Skip to content

Commit 9916201

Browse files
committed
null pointer fix
1 parent 2e14fab commit 9916201

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/com/pokegoapi/api/inventory/Inventories.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void updateInventories(boolean forceUpdate) throws LoginFailedException,
125125

126126
// pokebank
127127
if (itemData.getPokemonData().getPokemonId() != PokemonId.MISSINGNO) {
128-
pokebank.addPokemon(new Pokemon(inventoryItem.getInventoryItemData().getPokemonData()));
128+
pokebank.addPokemon(new Pokemon(api, inventoryItem.getInventoryItemData().getPokemonData()));
129129
}
130130

131131
// items

src/main/java/com/pokegoapi/api/pokemon/Pokemon.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
public class Pokemon {
4545

4646
private static final String TAG = Pokemon.class.getSimpleName();
47-
@Setter
48-
PokemonGo pgo;
47+
private final PokemonGo pgo;
4948
private PokemonData proto;
5049

5150
// API METHODS //
5251

5352
// DELEGATE METHODS BELOW //
54-
public Pokemon(PokemonData proto) {
53+
public Pokemon(PokemonGo api, PokemonData proto) {
54+
this.pgo = api;
5555
this.proto = proto;
5656
}
5757

0 commit comments

Comments
 (0)