Potential NPE when switching files in the compare dialog

This would happen when switching from a model file to a textual file
while having the property content merge viewer showing.

Change-Id: Id756a9c135db9849ac073ecb32cfd55bbb29474f
diff --git a/org.eclipse.emf.compare-parent/pom.xml b/org.eclipse.emf.compare-parent/pom.xml
index b344279..0b2fe13 100644
--- a/org.eclipse.emf.compare-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/pom.xml
@@ -137,6 +137,7 @@
       <plugin>
         <groupId>org.eclipse.tycho</groupId>
         <artifactId>target-platform-configuration</artifactId>
+        <version>${tycho-version}</version>
         <configuration>
           <includePackedArtifacts>true</includePackedArtifacts>
           <resolver>p2</resolver>
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
index 49f99b5..bed8e34 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/PropertyItem.java
@@ -107,11 +107,20 @@
 	 */
 	public static PropertyItem createPropertyItem(final EMFCompareConfiguration configuration,
 			final Object object, final MergeViewerSide side) {
-		final AdapterFactoryItemDelegator itemDelegator = new AdapterFactoryItemDelegator(
-				configuration.getAdapterFactory());
+		PropertyItem rootItem;
+		List<IItemPropertyDescriptor> propertyDescriptors;
+		if (configuration.getAdapterFactory() != null) {
+			final AdapterFactoryItemDelegator itemDelegator = new AdapterFactoryItemDelegator(
+					configuration.getAdapterFactory());
 
-		PropertyItem rootItem = new RootPropertyItem(configuration, itemDelegator, object, side);
-		List<IItemPropertyDescriptor> propertyDescriptors = getPropertyDescriptors(object, itemDelegator);
+			rootItem = new RootPropertyItem(configuration, itemDelegator.getImage(object),
+					itemDelegator.getText(object), object, side);
+			propertyDescriptors = getPropertyDescriptors(object, itemDelegator);
+		} else {
+			// We're currently disposing of the property content merge viewer
+			rootItem = new RootPropertyItem(configuration, null, "", object, side); //$NON-NLS-1$
+			propertyDescriptors = null;
+		}
 		populateRootPropertyItem(rootItem, propertyDescriptors, object, configuration, side);
 
 		return rootItem;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
index fc30618..ebd0780 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/property/RootPropertyItem.java
@@ -12,15 +12,14 @@
 
 import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
 import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
 
 class RootPropertyItem extends PropertyItem {
 
 	private Object object;
 
-	RootPropertyItem(EMFCompareConfiguration configuration, IItemLabelProvider itemLabelProvider,
+	RootPropertyItem(EMFCompareConfiguration configuration, Object objectImage, String objectText,
 			Object object, MergeViewerSide side) {
-		super(configuration, itemLabelProvider.getImage(object), itemLabelProvider.getText(object), side);
+		super(configuration, objectImage, objectText, side);
 		this.object = object;
 	}