Opened 12 years ago

Last modified 12 years ago

#9722 closed defect

'NoneType' object is unsubscriptable — at Version 1

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: SimpleTicketPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Sometimes, the following error occurs:

2012-01-22 12:06:23,170 Trac[main] ERROR: Exception caught while post-processing request: 
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 270, in dispatch
    self._post_process_request(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 359, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "build/bdist.linux-x86_64/egg/simpleticket/web_ui.py", line 40, in post_process_request
    data['fields'] = [f for f in data['fields'] if f['name'] not in self.fields]
TypeError: 'NoneType' object is unsubscriptable

A solution is to add “if f is not None” to the array comprehensions on lines 38 and 40 before it tries to use f['name'].

Change History (1)

comment:1 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

I'll go ahead and apply your fix. Any idea of the circumstances that result in a ticket field being none?

Note: See TracTickets for help on using tickets.