Fixed NullPointerException for packets