null check instead of empty check

As suggested by @psychoticmeow, use the null comparison
in order to let 0 be a valid default value.