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 4f5b715 commit d3c87dd
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 @@ -106,7 +106,7 @@ public void updateInventories(boolean forceUpdate) throws LoginFailedException,
InventoryItemDataOuterClass.InventoryItemData itemData = inventoryItem.getInventoryItemData();

if (itemData.getPokemonData().getPokemonId() != PokemonIdOuterClass.PokemonId.MISSINGNO) {
pokebank.addPokemon(new Pokemon(inventoryItem.getInventoryItemData().getPokemonData()));
pokebank.addPokemon(new Pokemon(api, inventoryItem.getInventoryItemData().getPokemonData()));
}
if (itemData.getItem().getItemId() != ItemId.UNRECOGNIZED
&& itemData.getItem().getItemId() != ItemId.ITEM_UNKNOWN) {
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 d3c87dd

Please sign in to comment.