Fix the exception of ext-viewport of history view + query view