No country is entirely guilty or innocent and victors write the history books and decide who gets the blame, but Poland suffered primarily due to poor leadership in their refusal to do a deal with Germany over Danzig, perhaps due to Britain’s mad “Polish Guarantee”.
Poland was a newly created country with many minorities within its borders and was foolish to believe it was a great power that could withstand invasion from both Soviet Union and Germany. That is resolving a dispute with Germany over Danzig was reasonable in context.
In practice Poland had to choose between Germany or Soviet Union, but really had more to fear from Soviet Union as they had conquered large parts of old Russian Empire during the civil war.
Therefore once the Nazi-Soviet pact was signed their fate was sealed unless they did a deal with Germany. The Pact was designed to bring Poland to the negotiation table as the ‘secret’ protocols to divide the country between their neighbours would have been made known to them.
This view is based on the very generous terms given to Soviet Union, which only made sense if Hitler expected the threat to work. It didn’t and Hitler’s tactical victory resulted in a strategic defeat by vastly increasing the power of Soviet Union. It was no doubt this that propelled Hitler to attack Soviet Union, whilst it was he thought, weak under communism, but would be a very strong danger under a resurgent Russian nationalism, when it finally arose.