Added failsafes to interactions against 'deleted' processes
This commit is contained in:
		| @@ -175,6 +175,7 @@ function modpol.interactions.org_dashboard(user, org_string) | |||||||
|       local processes = {} |       local processes = {} | ||||||
|       print("All processes: (* indicates pending)") |       print("All processes: (* indicates pending)") | ||||||
|       for i,v in ipairs(org.processes) do |       for i,v in ipairs(org.processes) do | ||||||
|  |          if v ~= "deleted" then | ||||||
|             local active = '' |             local active = '' | ||||||
|             if org.pending[user] then |             if org.pending[user] then | ||||||
|                if org.pending[user][v.id] then |                if org.pending[user][v.id] then | ||||||
| @@ -183,6 +184,7 @@ function modpol.interactions.org_dashboard(user, org_string) | |||||||
|             end |             end | ||||||
|             print("["..v.id.."] "..v.slug..active) |             print("["..v.id.."] "..v.slug..active) | ||||||
|          end |          end | ||||||
|  |       end | ||||||
|       print() |       print() | ||||||
|       print("Interact with which one (use [id] number)?") |       print("Interact with which one (use [id] number)?") | ||||||
|       local to_interact = io.read() |       local to_interact = io.read() | ||||||
|   | |||||||
| @@ -161,12 +161,14 @@ function modpol.interactions.org_dashboard(user, org_string) | |||||||
|    local num_pending = 0 |    local num_pending = 0 | ||||||
|    if org.pending[user] then |    if org.pending[user] then | ||||||
|       for k,v in pairs(org.pending[user]) do |       for k,v in pairs(org.pending[user]) do | ||||||
|  |          if org.processes[k] ~= "deleted" then | ||||||
|             local pending_string = org.processes[k].name |             local pending_string = org.processes[k].name | ||||||
|                .." ["..k.."]" |                .." ["..k.."]" | ||||||
|             table.insert(pending, pending_string) |             table.insert(pending, pending_string) | ||||||
|             num_pending = num_pending + 1 |             num_pending = num_pending + 1 | ||||||
|          end |          end | ||||||
|       end |       end | ||||||
|  |    end | ||||||
|    table.sort(pending) |    table.sort(pending) | ||||||
|  |  | ||||||
|    -- set player context |    -- set player context | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user