mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-17 04:22:54 +08:00
Added Try/Catch to prevent crashing if "Favorites.xml" cant be found
This commit is contained in:
parent
ba199212a6
commit
d86255de58
@ -3338,11 +3338,11 @@ namespace CodeWalker
|
||||
if (LocationTextBox.Text != "")
|
||||
{
|
||||
XmlDocument xDoc = new XmlDocument();
|
||||
xDoc.Load(@"C:\Users\Skyler\Documents\GitHub\CodeWalker\Resources\Favorites.xml");
|
||||
xDoc.Load(Application.StartupPath + @"Resources\Favorites.xml");
|
||||
XmlNode FavToAdd = xDoc.CreateElement("Favorite");
|
||||
FavToAdd.InnerText = LocationTextBox.Text;
|
||||
xDoc.DocumentElement.AppendChild(FavToAdd);
|
||||
xDoc.Save(@"C:\Users\Skyler\Documents\GitHub\CodeWalker\Resources\Favorites.xml");
|
||||
xDoc.Save(Application.StartupPath + @"Resources\Favorites.xml");
|
||||
LoadFavorites();
|
||||
}
|
||||
else
|
||||
|
@ -28,7 +28,7 @@ namespace CodeWalker.Explorer
|
||||
|
||||
private void Init()
|
||||
{
|
||||
xDoc.Load(@"C:\Users\Skyler\Documents\GitHub\CodeWalker\Resources\Favorites.xml");
|
||||
xDoc.Load(Application.StartupPath + @"Resources\Favorites.xml");
|
||||
FavoriteNodes = xDoc.DocumentElement.SelectNodes("Favorite");
|
||||
Root = xDoc.DocumentElement;
|
||||
foreach (XmlNode FavNode in FavoriteNodes)
|
||||
|
Loading…
Reference in New Issue
Block a user