Fix SQL errors being caused by $points being empty

I could not find why $points was empty, but a simple type check solves the
problem.

Change-Id: I174988e6e75978311150af41f3d98abb9b93454c