Revisions: Null checking

Fix possible NPE when inserting into Revisions table.

Change-Id: Ibaaa28cdb6dd4683bf7929f03e5a07e466a6bdcd