fix nil check

Fixes a nil check in HTTP module.