Guard against content provider exceptions

Change-Id: Iec8b5d802fb2fbdf078f522c7570558405e6d3b0