@@ -251,15 +251,16 @@ public static function fromV1(CampaignTargeting $targeting)
251251$ res ->martialStatus =$ targeting ->getMaritalStatus ();
252252$ res ->personalIncome =$ targeting ->getPersonalIncome ();
253253$ res ->remarketing =$ targeting ->getRemarketing ();
254- $ res ->pads = [];
255- foreach ($ targeting ->getPads ()as $ pad ) {
256- $ res ->pads [] =$ pad ->getId ();
257- }
258254$ res ->mobileTypes =$ targeting ->getMobileTypes ();
259255$ res ->mobileOperatingSystems =$ targeting ->getMobileOperatingSystems ();
260256$ res ->mobileOperators =$ targeting ->getMobileOperators ();
261257$ res ->mobileVendors =$ targeting ->getMobileVendors ();
262258
259+ $ res ->pads = [];
260+ foreach ($ targeting ->getPads () ?: []as $ pad ) {
261+ $ res ->pads [] =$ pad ->getId ();
262+ }
263+
263264if ($ targeting ->getSex ()) {
264265$ sex = [];
265266switch ($ targeting ->getSex ()->getValue ()) {
@@ -275,14 +276,13 @@ public static function fromV1(CampaignTargeting $targeting)
275276$ res ->sex =$ sex ;
276277 }
277278$ res ->regions = [];
278- if ($ targeting ->getRegions ()) {
279- foreach ($ targeting ->getRegions ()as $ id ) {
280- $ res ->regions [] =new Region ($ id );
281- }
279+ foreach ($ targeting ->getRegions () ?: []as $ id ) {
280+ $ res ->regions [] =new Region ($ id );
282281 }
283282if ($ targeting ->getUserGeo ()) {
284283$ res ->regions [] =new Region (null ,$ targeting ->getUserGeo ());
285284 }
285+
286286return $ res ;
287287 }
288288