Skip to content
Snippets Groups Projects
Commit 53191f55 authored by Riley Mcgee's avatar Riley Mcgee
Browse files

Quick fix of save function.

parent d908f2d3
No related branches found
No related tags found
No related merge requests found
......@@ -70,12 +70,11 @@ namespace Gifitti.Models
public void saveGif(string path)
{
//Error Handel on path
//RE for path with extension
Regex extensionTester = new Regex(@"^.*\.[g|G][i|I][f|F]$");
//RE for path without extension
Regex savePathTester = new Regex(@"^(([^\/\\]+)[\/\\])*([^\/\\]*)");
if (!savePathTester.IsMatch(path))
Regex savePathTester = new Regex(@"^((?:(?:[^\/\\]+)*[\/\\]*)*)[\/\\]([^\/\\]*)$");
if (!savePathTester.IsMatch(path) || !Directory.Exists(savePathTester.Match(path).Groups[1].ToString()))
{
throw new DirectoryNotFoundException();
}
......
......@@ -261,7 +261,7 @@ namespace Gifitti.View_Models
path = saveGifFileDialog.FileName;
//Handel Close
if (path.Equals(null))
if (path == null)
return;
//TODO temp write
Console.WriteLine(path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment