From 6047903ee6f052083b20227911c0d0c747760cea Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Sat, 16 Jun 2018 17:27:06 -0700 Subject: [PATCH] Fixed multiple benign warnings --- GitService/MysqlDatabase.cs | 2 +- Logging/Logger.cs | 2 +- MailService/MysqlDatabase.cs | 2 +- Piwik/Reporting.cs | 2 +- Piwik/Tracking.cs | 2 +- Teknik/Areas/Admin/Controllers/AdminController.cs | 2 +- Teknik/Areas/Podcast/Views/Podcast/Comments.cshtml | 2 +- Teknik/Areas/Podcast/Views/Podcast/Podcasts.cshtml | 2 +- Teknik/Areas/User/Controllers/UserController.cs | 4 ++-- Teknik/Filters/TrackDownload.cs | 2 -- Teknik/Filters/TrackLink.cs | 2 -- Teknik/Filters/TrackPageView.cs | 2 -- Teknik/Security/TeknikPrincipal.cs | 2 +- Teknik/Teknik.csproj | 4 +--- Utilities/Cryptography/PGP.cs | 2 +- Utilities/MysqlDatabase.cs | 2 +- Utilities/ResponseHelper.cs | 2 +- 17 files changed, 15 insertions(+), 23 deletions(-) diff --git a/GitService/MysqlDatabase.cs b/GitService/MysqlDatabase.cs index ff03091..cefc208 100644 --- a/GitService/MysqlDatabase.cs +++ b/GitService/MysqlDatabase.cs @@ -134,7 +134,7 @@ namespace Teknik.GitService Connection.Open(); Connected = true; } - catch (MySqlException ex) + catch (MySqlException) { Connected = false; } diff --git a/Logging/Logger.cs b/Logging/Logger.cs index 169baca..d08d054 100644 --- a/Logging/Logger.cs +++ b/Logging/Logger.cs @@ -154,7 +154,7 @@ namespace Teknik.Logging client.Send(mail); } - catch (Exception ex) { /* don't handle something in the handler */ + catch (Exception) { /* don't handle something in the handler */ } } } diff --git a/MailService/MysqlDatabase.cs b/MailService/MysqlDatabase.cs index f1100a5..83e6356 100644 --- a/MailService/MysqlDatabase.cs +++ b/MailService/MysqlDatabase.cs @@ -134,7 +134,7 @@ namespace Teknik.MailService Connection.Open(); Connected = true; } - catch (MySqlException ex) + catch (MySqlException) { Connected = false; } diff --git a/Piwik/Reporting.cs b/Piwik/Reporting.cs index d75945b..aff5d71 100644 --- a/Piwik/Reporting.cs +++ b/Piwik/Reporting.cs @@ -85,7 +85,7 @@ namespace Teknik.Piwik //} } } - catch (Exception ex) + catch (Exception) { } diff --git a/Piwik/Tracking.cs b/Piwik/Tracking.cs index 3c72336..0094d6f 100644 --- a/Piwik/Tracking.cs +++ b/Piwik/Tracking.cs @@ -45,7 +45,7 @@ namespace Teknik.Piwik //tracker.doTrackPageView(string.Format("{0}/{1}", sub, title)); } } - catch (Exception ex) + catch (Exception) { } diff --git a/Teknik/Areas/Admin/Controllers/AdminController.cs b/Teknik/Areas/Admin/Controllers/AdminController.cs index d91e577..5336ad9 100644 --- a/Teknik/Areas/Admin/Controllers/AdminController.cs +++ b/Teknik/Areas/Admin/Controllers/AdminController.cs @@ -87,7 +87,7 @@ namespace Teknik.Areas.Admin.Controllers model.LastSeen = UserHelper.GetLastAccountActivity(_dbContext, _config, user); models.Add(model); } - catch (Exception ex) + catch (Exception) { // Skip this result } diff --git a/Teknik/Areas/Podcast/Views/Podcast/Comments.cshtml b/Teknik/Areas/Podcast/Views/Podcast/Comments.cshtml index a5d25b1..3d148bd 100644 --- a/Teknik/Areas/Podcast/Views/Podcast/Comments.cshtml +++ b/Teknik/Areas/Podcast/Views/Podcast/Comments.cshtml @@ -2,5 +2,5 @@ @foreach (var comment in Model) { - @Html.Partial("Comment", comment) + @await Html.PartialAsync("Comment", comment) } diff --git a/Teknik/Areas/Podcast/Views/Podcast/Podcasts.cshtml b/Teknik/Areas/Podcast/Views/Podcast/Podcasts.cshtml index 36078b3..28feb37 100644 --- a/Teknik/Areas/Podcast/Views/Podcast/Podcasts.cshtml +++ b/Teknik/Areas/Podcast/Views/Podcast/Podcasts.cshtml @@ -2,5 +2,5 @@ @foreach (var podcast in Model) { - @Html.Partial("Podcast", podcast) + @await Html.PartialAsync("Podcast", podcast) } diff --git a/Teknik/Areas/User/Controllers/UserController.cs b/Teknik/Areas/User/Controllers/UserController.cs index 14347f9..d1668e7 100644 --- a/Teknik/Areas/User/Controllers/UserController.cs +++ b/Teknik/Areas/User/Controllers/UserController.cs @@ -742,7 +742,7 @@ namespace Teknik.Areas.Users.Controllers [HttpPost] [ValidateAntiForgeryToken] - public IActionResult Delete() + public async Task Delete() { if (ModelState.IsValid) { @@ -753,7 +753,7 @@ namespace Teknik.Areas.Users.Controllers { UserHelper.DeleteAccount(_dbContext, _config, user); // Sign Out - Logout(); + await Logout(); return Json(new { result = true }); } } diff --git a/Teknik/Filters/TrackDownload.cs b/Teknik/Filters/TrackDownload.cs index aab4c19..02f3853 100644 --- a/Teknik/Filters/TrackDownload.cs +++ b/Teknik/Filters/TrackDownload.cs @@ -15,8 +15,6 @@ namespace Teknik.Filters { public class TrackDownload : ActionFilterAttribute { - private readonly Config _config; - public TrackDownload() { //_config = config; diff --git a/Teknik/Filters/TrackLink.cs b/Teknik/Filters/TrackLink.cs index e1dfe43..e5fabc5 100644 --- a/Teknik/Filters/TrackLink.cs +++ b/Teknik/Filters/TrackLink.cs @@ -15,8 +15,6 @@ namespace Teknik.Filters { public class TrackLink : ActionFilterAttribute { - private readonly Config _config; - public TrackLink() { //_config = config; diff --git a/Teknik/Filters/TrackPageView.cs b/Teknik/Filters/TrackPageView.cs index 9e51471..9ba72e9 100644 --- a/Teknik/Filters/TrackPageView.cs +++ b/Teknik/Filters/TrackPageView.cs @@ -15,8 +15,6 @@ namespace Teknik.Filters { public class TrackPageView : ActionFilterAttribute { - private readonly Config _config; - public TrackPageView() { } diff --git a/Teknik/Security/TeknikPrincipal.cs b/Teknik/Security/TeknikPrincipal.cs index 0e294d5..2ee4813 100644 --- a/Teknik/Security/TeknikPrincipal.cs +++ b/Teknik/Security/TeknikPrincipal.cs @@ -22,7 +22,7 @@ namespace Teknik.Security } } - private User m_Info; + private User m_Info = null; public User Info { get diff --git a/Teknik/Teknik.csproj b/Teknik/Teknik.csproj index 40b4831..9462020 100644 --- a/Teknik/Teknik.csproj +++ b/Teknik/Teknik.csproj @@ -45,7 +45,6 @@ - @@ -70,8 +69,7 @@ - - + diff --git a/Utilities/Cryptography/PGP.cs b/Utilities/Cryptography/PGP.cs index 95ccc1d..0a6f4a5 100644 --- a/Utilities/Cryptography/PGP.cs +++ b/Utilities/Cryptography/PGP.cs @@ -29,7 +29,7 @@ namespace Teknik.Utilities.Cryptography } } } - catch (Exception ex) + catch (Exception) { isValid = false; } diff --git a/Utilities/MysqlDatabase.cs b/Utilities/MysqlDatabase.cs index c38ad67..3427d84 100644 --- a/Utilities/MysqlDatabase.cs +++ b/Utilities/MysqlDatabase.cs @@ -134,7 +134,7 @@ namespace Teknik.Utilities Connection.Open(); Connected = true; } - catch (MySqlException ex) + catch (MySqlException) { Connected = false; } diff --git a/Utilities/ResponseHelper.cs b/Utilities/ResponseHelper.cs index 5718c87..737f47f 100644 --- a/Utilities/ResponseHelper.cs +++ b/Utilities/ResponseHelper.cs @@ -46,7 +46,7 @@ namespace Teknik.Utilities } while (processedBytes > 0 && bytesRemaining > 0); } - catch (Exception ex) + catch (Exception) { // Don't worry about it. Just leave await response.Body.FlushAsync();