Index: branches/AutoShopper/BazaReklam/ProductionForm.cs
===================================================================
--- branches/AutoShopper/BazaReklam/ProductionForm.cs (revision 745)
+++ branches/AutoShopper/BazaReklam/ProductionForm.cs (revision 817)
@@ -457,16 +457,15 @@
                 foreach (Reklama reklama in lista)
                 {
-                    if (r["id reklamy"].ToString().ToLower().Contains(reklama.nrRek.ToLower()))
+                    if (!r["id reklamy"].ToString().ToLower().Contains(reklama.nrRek.ToLower())) continue;
+                    
+                    short test;
+
+                    if (reklama.costam.Count <= 1) continue;
+                    
+                    bool result = Int16.TryParse(reklama.costam[1], out test);
+                    if (result)
                     {
-                        short test;
-                        bool result = Int16.TryParse(reklama.costam[1], out test);
-
-                        // r["strona"] = Convert.ToInt16();
-
-                        if (result)
-                        {
-                            r["strona"] = test;
-                            reklama.wpisana = true;
-                        }
+                        r["strona"] = test;
+                        reklama.wpisana = true;
                     }
                 }
