fix null foreach when parameters is not set

getQuery method don't check iff the parameters var is set, so an exception is launched when calling getFullPath and base url don't have any query string.