We are having a lightning page on the community portal. The problem we are facing is as follows:
The Apex code is working fine & showing desired results only if we are setting debug logs for the logged in user to the community portal with debug level for apex code as "Finest".
But if we don't set debug logs or we set debug log with debug level for apex code other than "Finest" then apex code is not giving proper output. Also, it is not throwing an exception.
The highlighted if condition is always false in second case while it is working fine in first case.