Adds explicit validation of recent activity object type

… which creates a proper error message instead of an database exception.