Fix NPE in calculator

Two NPEs were introduced in this commit - 57e968a328017b210b02f45d3f644a6ad1edd1d8

This PR fixes one of them, and adds a comment for the other.  I'm not sure how to resolve the second NPE, as I'm not sure as to where we can get the stock_location.

On a related note, is there any reason the .travis.yml restricts test runs to master?  This neuters one of the best features of Travis integration - validation of PRs.  I'm basically adding this change to my local branch and removing it before submitting the PR - I'm not sure why this is disabled.