diff --git a/lib/WebGUI/Session/ErrorHandler.pm b/lib/WebGUI/Session/ErrorHandler.pm index c438feb59..50c5fd1eb 100644 --- a/lib/WebGUI/Session/ErrorHandler.pm +++ b/lib/WebGUI/Session/ErrorHandler.pm @@ -110,7 +110,10 @@ Returns true if the user meets the condition to see debugging information and de sub canShowDebug { my $self = shift; + + ##This check prevents in infinite loop during startup. return 0 unless ($self->session->hasSettings); + return 0 unless ($self->session->setting->get("showDebug")); return 0 unless (substr($self->session->http->getMimeType(),0,9) eq "text/html"); return $self->canShowBasedOnIP('debugIp');