Add field delimiter for the last field

I have a file with three fields and field delimiter '|' like:

abc|12:13:45|123
xyz|12:87:32|
qwe|54:21:09

In the file the 1st line has proper data -> abc|12:13:45|123
,the 2nd line doesnt has data for the 3rd field which is okay
, the 3rd line doesnt has data for the 3rd field as well the field delimiter before the 3rd field is also missing.

I have the requirement to add the field delimiter for the last field if the last field as well as the field delimiter is missing as with the case of the 3rd line:
the 3rd line should look like:

qwe|54:21:09|

Please help me in this?

One way:

awk -F"|" '{NF=3}1' OFS="|" file
$ awk -F\| 'NF == 2 { $0=$0 FS} 1' file
abc|12:13:45|123
xyz|12:87:32|
qwe|54:21:09|
# sed 's/\(.*|.*:.*:[0-9][0-9]*\)$/\1|/' file
abc|12:13:45|123
xyz|12:87:32|
qwe|54:21:09|

Thanks a lot friends.... this command worked :

# sed 's/\(.*|.*:.*:[0-9][0-9]*\)$/\1|/' file 

but for these commands i received this error:

$ awk -F"|" '{NF=3}1' OFS="|" file
awk: syntax error near line 1
awk: bailing out near line 1
 
$ awk -F\| 'NF == 2 { $0=$0 FS} 1' file
awk: syntax error near line 1
awk: bailing out near line 1

Am I doing something the wrong way?

regards,

Use nawk or /usr/xpg4/bin/awk on Solaris...