fix bug

if opts is null, program throw an error
Merge pull request #453 from zhanghaojie/patch-1

fix bug