Not only a smart move but also quite typical for that time. Note that Pilsudski was a kind of dictator and the Polish government was rather aggressive with respect to all its neighbors. Therefore, the war between Germany and Poland was a collision of two dictators - Hitler and Pilsudski.