Added reader closing (if it will help) and returns default group rather than "null"
This commit is contained in:
parent
c090d9a9f6
commit
30d0d48386
8 changed files with 37 additions and 13 deletions
|
|
@ -105,7 +105,10 @@ namespace TShockAPI.DB
|
|||
using (var reader = com.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
return new Warp(new Vector2(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"));
|
||||
{
|
||||
return new Warp(new Vector2(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID"));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -128,6 +131,8 @@ namespace TShockAPI.DB
|
|||
{
|
||||
while (reader.Read())
|
||||
Warps.Add(new Warp(new Vector2(reader.Get<int>("X"), reader.Get<int>("Y")), reader.Get<string>("WarpName"), reader.Get<string>("WorldID")));
|
||||
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue