Fix #13789: Don't throw when module === null. Close gh-1269. Close gh-1280. (cherry-picked from eabb56c27484cbffd2ce4951f661df83c91e5d7a)