The weapon is a Z6 riot control baton and is carried by the First Order Riot Control Stormtrooper (in the film you can see him toss aside the shield before taking on Finn)
The Z6 riot control baton, also known simply as the Z6 baton, was type
of baton used by First Order riot control stormtroopers to shock or
pummel an opponent. It was also capable of resisting the plasma
blade of a lightsaber. Stormtroopers normally used it in
conjunction with a betaplast riot shield, and the weapon itself was
capable of being spun around by its handle.
In the trailer - if you look closely, the part of the gun that is struck is glowing.
Thus - it is likely similar to the Magnadroid electrostaff
Electrostaffs were designed for single combat against lightsaber-wielders such as Jedi, and had the ability to block lightsaber strikes. Each end of the staff was tipped with electricity, and was powerful enough to stop a being's heart after five seconds' contact.
Here is a different gif that seems to show TFA version more clearly:
Also - it could be a shield of some kind - recall that in Episode 1 - Jinn and Kenobi flee the shielded battle droids because they "were no match for Droidekas"