Umbraco Razor - One Way to Check to See if A Node or Page Still Exists and or is Published

This can be used, for example, in a Partial View to see if a node is publish and or exists to ensure that the page does not throw an error when trying to write out details from a page or it's sub nodes .

var thisPage = Umbraco.Content(1256); // Get the page

@if(thisPage.Path != null && thisPage.Path != "")
   // Write out content from that page