Merge "optimizing: Fix a potential nullptr dereference"