A trivial fix would be to test value for None, but its better to try to figure out why its None in the first place.
A trivial fix would be to test value for None, but its better to try to figure out why its None in the first place.