Skip to content

Commit

Permalink
null pointer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmjelde committed Jul 23, 2016
1 parent 2e14fab commit 9916201
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/pokegoapi/api/inventory/Inventories.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void updateInventories(boolean forceUpdate) throws LoginFailedException,

// pokebank
if (itemData.getPokemonData().getPokemonId() != PokemonId.MISSINGNO) {
pokebank.addPokemon(new Pokemon(inventoryItem.getInventoryItemData().getPokemonData()));
pokebank.addPokemon(new Pokemon(api, inventoryItem.getInventoryItemData().getPokemonData()));
}

// items
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/pokegoapi/api/pokemon/Pokemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
public class Pokemon {

private static final String TAG = Pokemon.class.getSimpleName();
@Setter
PokemonGo pgo;
private final PokemonGo pgo;
private PokemonData proto;

// API METHODS //

// DELEGATE METHODS BELOW //
public Pokemon(PokemonData proto) {
public Pokemon(PokemonGo api, PokemonData proto) {
this.pgo = api;
this.proto = proto;
}

Expand Down

0 comments on commit 9916201

Please sign in to comment.