Erik_27939
Aug 20, 2014Nimbostratus
Solved
How do you handle a null variable in an irule?
I am using the below logic:
if { [string length $sort_dest_pool] > 0 } {
set dest_pool [string trimleft $sort_dest_pool "$loc"]
} else {
set dest_pool $orig_pool
}
If $sort_dest_pool is not defined, I get the following error/event:
can't read "sort_dest_pool": no such variable while executing "string length $sort_dest_pool"
According to this error, it is failing while trying to get the string length. This method was suggested as the solution for testing a string to see if it is set. Any ideas?
can you try to remove $?
e.g.
% info exists t 0 % set t 1 1 % info exists t 1