diff --git a/AUTHORS.md b/AUTHORS.md index 8482501b2..78704f711 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -123,6 +123,7 @@ date of first contribution): * [Khoi Pham](https://github.com/osubuu) * [Federico Nembrini](https://github.com/FedericoNembrini) * [Uri Shaked](https://github.com/urish) + * [Ollis Git](https://github.com/OllisGit) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/src/octoprint/static/js/app/helpers.js b/src/octoprint/static/js/app/helpers.js index fcc3e4e58..34a673469 100644 --- a/src/octoprint/static/js/app/helpers.js +++ b/src/octoprint/static/js/app/helpers.js @@ -1259,7 +1259,7 @@ function setOnViewModelIf(viewModel, key, value, condition) { viewModel[key] = value; } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Error while setting", key, "to", value, "on view model", viewModel.constructor.name, ":", (exc.stack || exc)); @@ -1277,7 +1277,7 @@ function callViewModelsIf(allViewModels, method, condition, callback) { try { callViewModelIf(viewModel, method, condition, callback); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Error calling", method, "on view model", viewModel.constructor.name, ":", (exc.stack || exc)); @@ -1339,7 +1339,7 @@ function callViewModelIf(viewModel, method, condition, callback, raiseErrors) { callback(viewModel[method], viewModel); } } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } if (raiseErrors) { diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js index c3d425cff..804adbca1 100644 --- a/src/octoprint/static/js/app/main.js +++ b/src/octoprint/static/js/app/main.js @@ -386,7 +386,7 @@ $(function() { try { viewModelInstance = _createViewModelInstance(viewModel, viewModelMap, optionalDependencyPass); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Error instantiating", viewModel.name, ":", (exc.stack || exc)); @@ -602,7 +602,7 @@ $(function() { _.each(allViewModelData, function (viewModelData) { try { if (!Array.isArray(viewModelData) || viewModelData.length !== 2) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(new Error("View model data for" + viewModelData.constructor.name + "has wrong format, expected 2-tuple (viewModel, targets), got:" + viewModelData)); } log.error("View model data for", viewModelData.constructor.name, "has wrong format, expected 2-tuple (viewModel, targets), got:", viewModelData); @@ -624,7 +624,7 @@ $(function() { try { callViewModel(viewModel, "onBeforeBinding", undefined, true); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Error calling onBeforeBinding on view model", viewModel.constructor.name, ":", (exc.stack || exc)); @@ -649,7 +649,7 @@ $(function() { try { object = $(target); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Error while attempting to jquery-fy target", target, "of view model", viewModel.constructor.name, ":", (exc.stack || exc)); @@ -678,7 +678,7 @@ $(function() { log.debug("View model", viewModel.constructor.name, "bound to", target); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } log.error("Could not bind view model", viewModel.constructor.name, "to target", target, ":", (exc.stack || exc)); @@ -718,7 +718,7 @@ $(function() { viewModelMap["uiStateViewModel"].loading(false); } catch (exc) { - if (Sentry) { + if (typeof Sentry !== 'undefined') { Sentry.captureException(exc); } viewModelMap["uiStateViewModel"].showLoadingError("Application startup failed.");