Bug 416391 - NullPointerException in FPRendering when adding in Mem view

Add null check. IModelProxyFactory.createModelProxy javadoc says
"Returns: model proxy or null". So a null check seems appropriate here.

Change-Id: I0d1ae4ca380c22d4f215b867d0ab5445b415a915
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/16088
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2013-09-03 22:14:52 -04:00
parent f6a7143011
commit 3bf07e8a61

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2010, 2012 Wind River Systems, Inc. and others.
* Copyright (c) 2006, 2010, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -275,8 +275,10 @@ public class FPRendering extends AbstractMemoryRendering
* the model provider.
*/
fModel = factory.createModelProxy(block, context);
fModel.installed(null);
fModel.addModelChangedListener(FPRendering.this);
if (fModel != null) {
fModel.installed(null);
fModel.addModelChangedListener(FPRendering.this);
}
}});
}