Check that error isn't nil before assigning
Merge pull request #28 from mlitbk/keychainbug

fix #26 Check that error isn't nil before assigning