add an if when call an @optional method
Merge pull request #39 from yangchenlarkin/develop

add an if when call an @optional method