One of the parameters your GatewayHook class is passing to addScriptModule is probably null. obj maybe?
GatewayHook
addScriptModule
null
obj