coverity defect fixed
Merge pull request #2405 from mazumdarparijat/gradient

coverity defect fixed