Fix a possible NPE in if
Merge pull request #3 from SuperWang/origin

Fix a possible NPE in if