Merge pull request #3 from SuperWang/origin

Fix a possible NPE in if