17 Apr
2007
17 Apr
'07
11:55 a.m.
Hi, Here's another one best practice I'd like to propose: Instead of writing: #set($obj = ...) #if ($obj.getSomething() == "...") Write: #if($obj && $obj.getSomething() == "...") This prevents the following error in logs: 11:54:04,777 ERROR P1-19 ... SimpleLog4JLogSystem:logVelocityMessage: 154 - Left side ($obj.getSomething()) of '==' operation has null value. If a reference, it may not be in the context. Operation not possible. [line 1, column 21] WDYT? Thanks -Vincent