see #1160
Permissions/IO errors can cause nullpointerexception
Fixes #1160

Merge remote-tracking branch 'arduino/master-issue1160'
Updated revisions log