diff options
| author | Michael <[email protected]> | 2017-03-25 16:56:05 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-25 16:56:05 -0400 |
| commit | be641700f8f0e549861f0223b42674e7c83e0bc7 (patch) | |
| tree | ec259d26b61fdda4b2d888c8c6d2503f297cf88b /Project-Unite/Controllers/ManageController.cs | |
| parent | d5e460acf2f9696fcecfa63d91f6b03064b1557f (diff) | |
| download | project-unite-be641700f8f0e549861f0223b42674e7c83e0bc7.tar.gz project-unite-be641700f8f0e549861f0223b42674e7c83e0bc7.tar.bz2 project-unite-be641700f8f0e549861f0223b42674e7c83e0bc7.zip | |
Bagels.
Diffstat (limited to 'Project-Unite/Controllers/ManageController.cs')
| -rw-r--r-- | Project-Unite/Controllers/ManageController.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs index 5f68eea..99f41c9 100644 --- a/Project-Unite/Controllers/ManageController.cs +++ b/Project-Unite/Controllers/ManageController.cs @@ -43,12 +43,15 @@ namespace Project_Unite.Controllers string[] allowedTypes = new[] { ".png", ".jpg", ".bmp", ".jpeg", ".gif" }; bool containsAllowedType = false; - foreach(var ending in allowedTypes) + if (model.Image != null) { - if (model.Image.FileName.EndsWith(ending)) + foreach (var ending in allowedTypes) { - containsAllowedType = true; - break; + if (model.Image.FileName.EndsWith(ending)) + { + containsAllowedType = true; + break; + } } } if (containsAllowedType == false) |
