In 1940 , when Norway was invaded by Germany , Lie ordered all Norwegian ships to sail to Allied ports . In 1940 , when Norway was invaded by Nazi Germany , Lie ordered all Norwegian ships to sail to Allied ports .