Prevent NPE if Fragment reference is null.