fix Issue 11513 - Assertion in module.c
Merge pull request #2759 from 9rnsr/fix11513

[REG2.064] Issue 11513 - Assertion in module.c