added null check for getconnectionbetweenarticlesforrelationquery