hash: check for NULL label in hash_get().

The label parameter was being used without checking if it was NULL.
This could be a problem, so this patch adds a check for NULL.