fix Issue 13417 - segmentation fault when deduce template type
Merge pull request #3950 from 9rnsr/fix13417

[REG2.066] Issue 13417 - segmentation fault when deduce template type