Fix null reference exception during "kpm pack --runtime"

parent #684 
Yah.