i love how people on these boards think they know their law. Ttaking a k9 around a closed car is not considered a search, and when the dog barks, sniffs, or does anything hinting that there's weed in the car, that gives the cops "probable cause", which means they have the right to search your car front to back side to side.

You lucked out man, let this be a lesson to you and don't get yourself in this situation again, you may not be so lucky next time.