Check $order value before using it.