avoid null ptr deref, from glenn@sun