Added null check to fix barrel gui bug.