Ticket #9722 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

'NoneType' object is unsubscriptable

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: SimpleTicketPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (Last modified by rjollos)

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'].

Attachments

Change History

01/23/12 04:39:26 changed by rjollos

  • description changed.

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

01/23/12 05:40:34 changed by rjollos

(In [11178]) Refs #9722: Check if a ticket field is None before trying to add it to the list of fields to be filtered (or not to be filtered, depending on the show_only setting).

01/23/12 05:41:20 changed by rjollos

  • status changed from new to assigned.

I added the check, but I'd like to reproduce the issue, so I'd appreciate if you can provide more details regarding your Trac installation.

02/01/12 07:24:23 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

Well, please follow up if you can.


Add/Change #9722 ('NoneType' object is unsubscriptable)




Change Properties
Action