[Reportbug-maint] Bug#535789: reportbug crash when trying to detach a not attached file

Sandro Tosi morph at debian.org
Sat Jul 11 17:26:00 UTC 2009


On Sat, Jul 11, 2009 at 19:17, Rodrigo Campos<rodrigo at sdfg.com.ar> wrote:
> I like more the fix that lets you change your mind and not detach anything
> also :)
>
> Sorry, but I have one question about the fix you did. You used:
>
>        if filetodetach != '' and filetodetach in attachments
>
> to avoid the crash.
>
> But if I'm not wrong "filetodetach == ''" could not happend (because if the user
> click 'enter', filetodetach is None, so perhaps the check should be if its
> different to None) and even if it happens, its not in the list (nor
> None or ''), so it will fail the other check (filetodetach in attachments).
>
> Also, if you forget about context and just think "What do I need to know if I
> want to safely remove an element from a list ?", you need to know that the
> element is in the list, if it is, you can safely remove it. So that is all you
> need to check (you can have other check to give a better error, but the ui.menu
> function is doing that already if I'm not wrong).
>
> So that "if filetodetach != ''" check is not needed (again, if I'm not wrong :).

I know, but I'd rather be safe than sorry :) so a stronger check is
not that bad, just in case someone "hacks" on attachs and results in
an empty item.

> PS: sorry for not repliying your mail, I don't know why the BTS didn't email me
> this, I thought it would email me any answer to a bug I have reported.

yeah, mailing nnnnnn at bugs.debian.org don't email the submitter.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi





More information about the Reportbug-maint mailing list