Index: plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfImporter.java
===================================================================
--- plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfImporter.java	(revision 32857)
+++ plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfImporter.java	(working copy)
@@ -11,7 +11,6 @@
 import org.openstreetmap.josm.io.CachedFile;
 import org.openstreetmap.josm.io.OsmImporter;
 import org.openstreetmap.josm.plugins.pbf.PbfConstants;
-import org.xml.sax.SAXException;
 
 /**
  * @author Don-vip
@@ -28,7 +27,9 @@
 		return PbfReader.parseDataSet(in, progressMonitor);
 	}
 
-	protected DataSet parseDataSet(final String source) throws IOException, SAXException, IllegalDataException {
-        return parseDataSet(new CachedFile(source).getInputStream(), NullProgressMonitor.INSTANCE);
+	protected DataSet parseDataSet(final String source) throws IOException, IllegalDataException {
+		try(CachedFile cf = new CachedFile(source)) {
+			return parseDataSet(cf.getInputStream(), NullProgressMonitor.INSTANCE);
+		}
 	}
 }
Index: plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfReader.java
===================================================================
--- plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfReader.java	(revision 32857)
+++ plugins/pbf/src/org/openstreetmap/josm/plugins/pbf/io/PbfReader.java	(working copy)
@@ -31,6 +31,7 @@
 
 import crosby.binary.BinaryParser;
 import crosby.binary.Osmformat;
+import crosby.binary.Osmformat.DenseInfo;
 import crosby.binary.Osmformat.DenseNodes;
 import crosby.binary.Osmformat.HeaderBBox;
 import crosby.binary.Osmformat.HeaderBlock;
@@ -47,7 +48,7 @@
     protected class PbfParser extends BinaryParser {
 
         public IllegalDataException exception = null;
-        
+        private boolean discourageUpload;
         private double parseRawDegrees(long raw) {
             return raw * .000000001;
         }
@@ -108,6 +109,8 @@
 
         @Override
         protected void parseDense(DenseNodes nodes) {
+        	if (nodes.hasDenseinfo() == false)
+        		discourageUpload = true;
             if (exception == null) {
                 try {
                     int keyIndex = 0;
@@ -121,18 +124,26 @@
                     long timestamp = 0;
                     for (int i = 0; i < nodes.getIdCount(); i++) {
                         // Id (delta) and version (normal)
-                        Node node = new Node(nodeId+=nodes.getId(i), nodes.getDenseinfo().getVersion(i));
+                        Node node = new Node(nodeId+=nodes.getId(i), nodes.hasDenseinfo() ? nodes.getDenseinfo().getVersion(i): 1);
                         // Lat/Lon (delta)
                         node.setCoor(new LatLon(parseLat(nodeLat+=nodes.getLat(i)), parseLon(nodeLon+=nodes.getLon(i))).getRoundedToOsmPrecision());
                         checkCoordinates(node.getCoor());
-                        // Changeset (delta)
-                        checkChangesetId(changesetId+=nodes.getDenseinfo().getChangeset(i));
-                        node.setChangesetId((int) changesetId);
-                        // User (delta)
-                        node.setUser(User.createOsmUser(uid+=nodes.getDenseinfo().getUid(i), getStringById(suid+=nodes.getDenseinfo().getUserSid(i))));
-                        // Timestamp (delta)
-                        checkTimestamp(timestamp+=nodes.getDenseinfo().getTimestamp(i));
-                        node.setTimestamp(new Date(date_granularity * timestamp));
+                        if (nodes.hasDenseinfo()) {
+                        	// Changeset (delta)
+                        	if (nodes.getDenseinfo().getChangesetCount() > i) {
+                        		checkChangesetId(changesetId+=nodes.getDenseinfo().getChangeset(i));
+                        		node.setChangesetId((int) changesetId);
+                        	}
+                    		// User (delta)
+                        	if (nodes.getDenseinfo().getUidCount() > i && nodes.getDenseinfo().getUserSidCount() > i) {
+                        		node.setUser(User.createOsmUser(uid+=nodes.getDenseinfo().getUid(i), getStringById(suid+=nodes.getDenseinfo().getUserSid(i))));
+                        	}
+                        	// Timestamp (delta)
+                        	if (nodes.getDenseinfo().getTimestampCount() > i) {
+                        		checkTimestamp(timestamp+=nodes.getDenseinfo().getTimestamp(i));
+                        		node.setTimestamp(new Date(date_granularity * timestamp));
+                        	}
+                        }
                         // A single table contains all keys/values of all nodes.
                         // Each node's tags are encoded in alternating <key_id> <value_id>.
                         // A single stringid of 0 delimit when the tags of a node ends and the tags of the next node begin.
@@ -163,14 +174,21 @@
                 try {
                     for (Osmformat.Node n : osmNodes) {
                     	final Info info = n.getInfo();
-                        final Node node = new Node(n.getId(), info.getVersion());
+                    	if (info.hasVersion() == false)
+                    		discourageUpload = true;
+                        final Node node = new Node(n.getId(), info.hasVersion() ? info.getVersion() : 1);
                         node.setCoor(new LatLon(parseLat(n.getLat()), parseLon(n.getLon())).getRoundedToOsmPrecision());
                         checkCoordinates(node.getCoor());
-                        checkChangesetId(info.getChangeset());
-                        node.setChangesetId((int) info.getChangeset());
-                        node.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
-                        checkTimestamp(info.getTimestamp());
-                        node.setTimestamp(getDate(info));
+                        if (info.hasChangeset()) {
+                        	checkChangesetId(info.getChangeset());
+                        	node.setChangesetId((int) info.getChangeset());
+                        }
+                        if (info.hasUid() && info.hasUserSid())
+                        	node.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
+                        if (info.hasTimestamp()) {
+                        	checkTimestamp(info.getTimestamp());
+                        	node.setTimestamp(getDate(info));
+                        }
                         Map<String, String> keys = new HashMap<>();
                         for (int i=0; i<n.getKeysCount(); i++) {
                             keys.put(getStringById(n.getKeys(i)), getStringById(n.getVals(i)));
@@ -190,12 +208,20 @@
                 try {
                     for (Osmformat.Way w : osmWays) {
                     	final Info info = w.getInfo();
-                        final Way way = new Way(w.getId(), info.getVersion());
-                        checkChangesetId(info.getChangeset());
-                        way.setChangesetId((int) info.getChangeset());
-                        way.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
-                        checkTimestamp(info.getTimestamp());
-                        way.setTimestamp(getDate(info));
+                    	if (info.hasVersion() == false)
+                    		discourageUpload = true;
+                        final Way way = new Way(w.getId(), info.hasVersion() ? info.getVersion() : 1);
+                        if (info.hasChangeset()) {
+                        	checkChangesetId(info.getChangeset());
+                        	way.setChangesetId((int) info.getChangeset());
+                        }
+                        if (info.hasUid() && info.hasUserSid()) {
+                        	way.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
+                        }
+                        if (info.hasTimestamp()) {
+                        	checkTimestamp(info.getTimestamp());
+                        	way.setTimestamp(getDate(info));
+                        }
                         Map<String, String> keys = new HashMap<>();
                         for (int i=0; i<w.getKeysCount(); i++) {
                             keys.put(getStringById(w.getKeys(i)), getStringById(w.getVals(i)));
@@ -221,12 +247,20 @@
                 try {
                     for (Osmformat.Relation r : osmRels) {
                     	final Info info = r.getInfo();
-                        final Relation rel = new Relation(r.getId(), info.getVersion());
-                        checkChangesetId(info.getChangeset());
-                        rel.setChangesetId((int) info.getChangeset());
-                        rel.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
-                        checkTimestamp(info.getTimestamp());
-                        rel.setTimestamp(getDate(info));
+                    	if (info.hasVersion() == false)
+                    		discourageUpload = true;
+                        final Relation rel = new Relation(r.getId(), info.hasVersion() ? info.getVersion() : 1);
+                        if (info.hasChangeset()) {
+                        	checkChangesetId(info.getChangeset());
+                        	rel.setChangesetId((int) info.getChangeset());
+                        }
+                        if (info.hasUid() && info.hasUserSid()) {
+                        	rel.setUser(User.createOsmUser(info.getUid(), getStringById(info.getUserSid())));
+                        }
+                        if (info.hasTimestamp()) {
+                        	checkTimestamp(info.getTimestamp());
+                        	rel.setTimestamp(getDate(info));
+                        }
                         Map<String, String> keys = new HashMap<>();
                         for (int i=0; i<r.getKeysCount(); i++) {
                             keys.put(getStringById(r.getKeys(i)), getStringById(r.getVals(i)));
@@ -258,10 +292,14 @@
                     exception = e;
                 }
             }
+            if (discourageUpload)
+            	ds.setUploadDiscouraged(true);
         }
 
         @Override
         public void complete() {
+            if (discourageUpload)
+            	ds.setUploadDiscouraged(true);
         }
     }
 
