Prevent NPE on empty tables

Change-Id: I03b1491040e6f40612e341d162cc7acf32275280
Signed-off-by: Galo Navarro <galo@midokura.com>