Tk Library Source Code

View Ticket
Login
Ticket UUID: 1242740
Title: Error in tkcat::addAction
Type: Bug Version: None
Submitter: pointsman Created on: 2005-07-22 01:54:03
Subsystem: tclapps :: tkchat Assigned To: patthoyts
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-08-18 19:07:31
Resolution: Fixed Closed By: patthoyts
    Closed on: 2005-08-18 12:07:31
Description:
In the wild, with tkchat v1.301 I got abrupt the error:


can't read "tags": no such variable
can't read "tags": no such variable
    while executing
"$w insert $mark "\n" $tags"
    (procedure "::tkchat::addAction" line 38)
    invoked from within
"::tkchat::addAction .txt $color $nick $msg $mark
$timestamp $opts"
    (procedure "::tkjabber::parseMsg" line 47)
    invoked from within
"::tkjabber::parseMsg $from $m(-body) $color end
$timestamp"
    ("groupchat" arm line 23)
    invoked from within
"switch -- $type {
        chat {
            set from $m(-from)
            set w .txt
            set name $from
            if { [regexp {([^/]+)/(.+)} $m(-from) ->
conf name] } {
                i..."
    (procedure "::tkjabber::MsgCB" line 42)
    invoked from within
etc.


Can't say, what triggered this, but it seems, that
tkchat::addAction is too credulous. In the line 

  $w insert $mark "\n" $tags

it depends on the variable tags to exist. But this
variable is only set within this foreach loop in the proc:

    foreach { str url } [parseStr $str] {
       ....
    }

which will run 0 times, if [parseStr] returns the empty
list (which is possible, as a look at that proc shows
and the error msg demonstrates), let tags unset.
User Comments: patthoyts added on 2005-08-18 19:07:31:
Logged In: YES 
user_id=202636

Fixed by Reinhard Max in version 1.302