check for nulls before querying the database
throw an exception when needed, prevents html error pages parsing