[#1241] Fix NPE in AbstractTrafficShapingHandler and the logic