Merge pull request #840 from kasenvr/fix/ess-logging-crash

Prevent crash on entity-script-server due to logging interface.
This commit is contained in:
kasenvr 2020-10-25 23:09:05 -04:00 committed by GitHub
commit 5c945c1524
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine) {
// This message was sent by one of our script engines, let's try to see if we can find the source.
// Note that the first entry in the backtrace should be "print" and is somewhat useless to us
AbstractLoggerInterface* loggerInterface = AbstractLoggerInterface::get();
if (loggerInterface->showSourceDebugging()) {
if (loggerInterface && loggerInterface->showSourceDebugging()) {
QScriptContext* userContext = context;
while (userContext && QScriptContextInfo(userContext).functionType() == QScriptContextInfo::NativeFunction) {
userContext = userContext->parentContext();